Comments (4)
Definitely possible. Would be nice if data didn't need to be duplicated on disk just for the read. I will get something put together later this week and let you know when it's up.
from rfia.
Just updated readFIA
, a fresh install from Github and you should be good to go. Note that readFIA
now includes the states
argument, which allows the user to read in selected states from a common directory. For example, if you downloaded all states in the Northeast and stored the data together for regional analysis, but for now only want to read in MA, simply specify states = 'MA'
Here is an example:
## Set up a directory to store data
d <- 'my/test/directory/'
## Store RI, MA, and CT in same directory
getFIA(c('CT', 'RI', 'MA'), dir = d)
## Read CT only
ct <- readFIA(d, states = 'CT')
summary(ct)
---- FIA Database Object -----
Reporting Years: 1985 1998 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
States: CONNECTICUT
Total Plots: 1813
Memory Used: 77.3 Mb
Tables: COND COND_DWM_CALC INVASIVE_SUBPLOT_SPP PLOT POP_ESTN_UNIT POP_EVAL POP_EVAL_GRP POP_EVAL_TYP POP_PLOT_STRATUM_ASSGN POP_STRATUM SEEDLING SUBP_COND SUBP_COND_CHNG_MTRX SUBPLOT SURVEY TREE TREE_GRM_BEGIN TREE_GRM_COMPONENT TREE_GRM_MIDPT
## Read RI only
ri <- readFIA(d, states = 'RI')
summary(ri)
---- FIA Database Object -----
Reporting Years: 1985 1998 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
States: RHODE ISLAND
Total Plots: 769
Memory Used: 32 Mb
Tables: COND COND_DWM_CALC INVASIVE_SUBPLOT_SPP PLOT POP_ESTN_UNIT POP_EVAL POP_EVAL_GRP POP_EVAL_TYP POP_PLOT_STRATUM_ASSGN POP_STRATUM SEEDLING SUBP_COND SUBP_COND_CHNG_MTRX SUBPLOT SURVEY TREE TREE_GRM_BEGIN TREE_GRM_COMPONENT TREE_GRM_MIDPT
## Read in RI & CT, but not MA
ri_ct <- readFIA(d, states = c('RI', 'CT'))
summary(ri_ct)
---- FIA Database Object -----
Reporting Years: 1985 1998 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
States: CONNECTICUT RHODE ISLAND
Total Plots: 2582
Memory Used: 109.1 Mb
Tables: COND COND_DWM_CALC INVASIVE_SUBPLOT_SPP PLOT POP_ESTN_UNIT POP_EVAL POP_EVAL_GRP POP_EVAL_TYP POP_PLOT_STRATUM_ASSGN POP_STRATUM SEEDLING SUBP_COND SUBP_COND_CHNG_MTRX SUBPLOT SURVEY TREE TREE_GRM_BEGIN TREE_GRM_COMPONENT TREE_GRM_MIDPT
## Read in all states in the directory
allStates <- readFIA(d)
summary(allStates)
---- FIA Database Object -----
Reporting Years: 1985 1998 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
States: CONNECTICUT MASSACHUSETTS RHODE ISLAND
Total Plots: 5497
Memory Used: 257.1 Mb
Tables: COND COND_DWM_CALC INVASIVE_SUBPLOT_SPP PLOT POP_ESTN_UNIT POP_EVAL POP_EVAL_GRP POP_EVAL_TYP POP_PLOT_STRATUM_ASSGN POP_STRATUM SEEDLING SUBP_COND SUBP_COND_CHNG_MTRX SUBPLOT SURVEY TREE TREE_GRM_BEGIN TREE_GRM_COMPONENT TREE_GRM_MIDPT
from rfia.
This is awesome. Thanks Hunter!
from rfia.
Anytime!
from rfia.
Related Issues (20)
- mergeSmallStrata(): 'buf' not 'buff' to id intensified PNW strata HOT 1
- readFIA issues HOT 2
- Issue with getFIA - url connects to 404 page HOT 6
- Difficulty using huc watersheds as polygons HOT 2
- Summarizing by subplot gives wrong values
- rFIA::tpa() removes trees with no measured DIA
- FIA databases appear to be inaccessible HOT 2
- Error in `dplyr::select()`: Column `geom` doesn't exist. HOT 1
- 'EVALID' not found error using 'readFIA' from file & using 'getFIA' for multiple states HOT 7
- df issue in udTreeDomain() within biomass()
- getFIA URL error HOT 2
- growMort bySizeClass missing removed stems
- Failure with dev dtplyr
- fa_mean doesn't exist HOT 5
- 'invasive' function not finding INVASIVE_SUBPLOT_SPP table HOT 1
- Newest version of R not compatible
- seemingly strange behavior from customPSE()
- 'DRYBIO_WDLD_SPP' and Column `CARBON_STANDING_DEAD` not found HOT 4
- Error when downloading tables for several states HOT 3
- growMort function won't run HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rfia.