Giter Site home page Giter Site logo

readFIA feature wish about rfia HOT 4 CLOSED

hunter-stanke avatar hunter-stanke commented on September 17, 2024
readFIA feature wish

from rfia.

Comments (4)

hunter-stanke avatar hunter-stanke commented on September 17, 2024 1

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.

hunter-stanke avatar hunter-stanke commented on September 17, 2024

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.

djj4tree avatar djj4tree commented on September 17, 2024

This is awesome. Thanks Hunter!

from rfia.

hunter-stanke avatar hunter-stanke commented on September 17, 2024

Anytime!

from rfia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.