Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'DRYBIO_WDLD_SPP' and Column CARBON_STANDING_DEAD not found #48

Open
ryanmismith opened this issue Nov 28, 2023 · 4 comments · May be fixed by #51
Open

'DRYBIO_WDLD_SPP' and Column CARBON_STANDING_DEAD not found #48

ryanmismith opened this issue Nov 28, 2023 · 4 comments · May be fixed by #51

Comments

@ryanmismith
Copy link

I downloaded the Maine csv zip from the FIA website due to issues with getFIA. The example code on the rFIA website worked fine, but the biomass and carbon functions are returning errors.

For biomass:
Error in eval(jsub, SDenv, parent.frame()) :
object 'DRYBIO_WDLD_SPP' not found

For carbon:
! Can't subset columns that don't exist.
✖ Column CARBON_STANDING_DEAD doesn't exist.

I have not been able to identify where these variables can be found in the FIA datamart. Any help would be appreciated!

@brlockwood
Copy link

brlockwood commented Jan 22, 2024

I'm getting a similar error from the biomass function using data from Pennsylvania:

Error in fcase(is.na(DIA), NA_real_, !is.na(DRYBIO_WDLD_SPP), DRYBIO_WDLD_SPP/(jTotal - : object 'DRYBIO_WDLD_SPP' not found

According to the FIA documentation:

DRYBIO_WDLD_SPP Aboveground dry biomass of woodland tree species. The oven-dry biomass, in pounds, of the aboveground portion of a live or dead tree, excluding foliage, the tree tip (top of the tree above 1.5 inches in diameter), and a portion of the stump from ground to diameter at root collar (d.r.c.). Calculated for woodland species (trees where diameter is measured at d.r.c.) with a diameter 1.0 inch. This is a per tree value and must be multiplied by TPA_UNADJ to obtain per acre information. This attribute is blank (null) for woodland species with DIA <1.0 inch and for all timber species.

DRYBIO_WDLD_SPP is referenced in the bioStarter function, which is then called within the biomass function, within biomass_new.R. From what I can gather, the purpose here seems to be to calculate aboveground biomass when diameter data is lacking (DIA is < 1 inch).

For data from Pennsylvania, the TREE table does not appear to contain a DRYBIO_WDLD_SPP field, which may be causing the issue.

@ryanmismith
Copy link
Author

Have you found a work around? Is it possible to just have the functions skip the variable if it's not found or would we be getting bogus results?

@HocfaiSun
Copy link

Have you found a work around? Is it possible to just have the functions skip the variable if it's not found or would we be getting bogus results?

Hi ryanmismith,

I find the solution to solve this problem, you can add a column DRYBIO_WDLD_SPP with all values as NA to TREE, for example:

db = readFIA('data/AL/')

db$TREE$DRYBIO_WDLD_SPP = NA

bio_pltSF = biomass(db, byPlot = TRUE, returnSpatial = TRUE)

I have checked the fiaRI data in rFIA package, there is a DRYBIO_WDLD_SPP column, but there is no such column in AL or other states, you shoud add such column by your self.

Hope this solution can help.

@d-diaz
Copy link

d-diaz commented Jul 18, 2024

Several columns that rFIA expects to find in the FIA database have been removed from the versions now being distributed by the USFS. I'll submit a PR shortly that incorporates a few changes to the biomass_new.R and carbon_new.R scripts that run with current versions of the FIA databases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants