ropensci / allodb

An R package for biomass estimation at extratropical forest plots.
https://docs.ropensci.org/allodb/
GNU General Public License v3.0
36 stars 11 forks source link

errors in get_biomass #105

Closed ValentineHerr closed 4 years ago

ValentineHerr commented 4 years ago

, with = FALSE in this line of code is generating an error for me.

ValentineHerr commented 4 years ago

it looks like these columns:

are supposed to be in equations as these lines are tying to pull them from there, but they don't seem to exist in equations

cpiponiot commented 4 years ago

they should be in equations, when I try this: load("data/equations.rda"); colnames(equations) all the columns you mentioned appear

cpiponiot commented 4 years ago

, with = FALSE in this line of code is generating an error for me.

this should be fixed now (I added a line to load the data.table package in the function). Whether we should use this package or not is another question, I could try 2 versions of the function, with or without it, and see if there is a big gain in running time that justifies using data.table

ValentineHerr commented 4 years ago

@cpiponiot what do you get when running library(allodb) data("equations") names(equations) ?

For me, equations has much fewer columns when I load the package than when I take directly from the repo... weird!

ValentineHerr commented 4 years ago

There must be a missing dependency as I get the following error when running get_biomass()

Error in set(taxo_weight_census, i = which(is.na(taxo_weight_census[[col]])), : could not find function "set"

cpiponiot commented 4 years ago

Have you pulled the commits from yesterday? The function set() is from the data.table package too, which should be loaded inside the get_biomass() function now

ValentineHerr commented 4 years ago

Oh right, sorry for that.

I am trying to re-install allodb via remotes::install_github('forestgeo/allodb') to update it but I am getting errors.... I'll try to figure out what is going on.

cpiponiot commented 4 years ago

Yes, me too, I guess for now it's best to just use it directly from the repo (probably some formatting issue, we can figure this one later)

ValentineHerr commented 4 years ago

First, FYI, I get this warning:

NB: this package now depends on R (>= 3.5.0) WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'allodb/data/koppenMatrix.rda' 'allodb/data/koppenRaster.rda' WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'allodb/data/taxo_weight.rda' 'allodb/data/temp_censusTaxa.rda' WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'allodb/data/temp_equationTaxa.rda'

I am runninf this version of R: R version 3.6.2 (2019-12-12)

ValentineHerr commented 4 years ago

Yes, me too, I guess for now it's best to just use it directly from the repo (probably some formatting issue, we can figure this one later)

ok

cpiponiot commented 4 years ago

First, FYI, I get this warning:

NB: this package now depends on R (>= 3.5.0) WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'allodb/data/koppenMatrix.rda' 'allodb/data/koppenRaster.rda' WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'allodb/data/taxo_weight.rda' 'allodb/data/temp_censusTaxa.rda' WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'allodb/data/temp_equationTaxa.rda'

I am runninf this version of R: R version 3.6.2 (2019-12-12)

Yeah okay I see what the issue is, it'll be easy to fix I think. It's just that the class of the objects is not supported by base R, but I just have to save them in another format.

gonzalezeb commented 4 years ago

get_biomass is working well now.