izaopenshaw / WoodlandCarbonCode

R Package that Calculates Carbon Using the Woodland Carbon Code
GNU General Public License v3.0
0 stars 0 forks source link

lookspcode #1

Closed gistin closed 2 weeks ago

gistin commented 3 weeks ago

throwing an error, looks like sp_lookupdf or lookup_df is not found or loading?

gistin commented 3 weeks ago

Specific error

Error in lookspcode("Quercus robur", type = "broadleaf", returnv = "short") : object '"short"' not found In addition: Warning message: In utils::data(sp_lookupdf, envir = environment()) : data set ‘sp_lookupdf’ not found

izaopenshaw commented 3 weeks ago

This is strange, as on a separate project I get a result for lookspcode("Quercus robur", type = "broadleaf", returnv = "short") spname spcode matchtype 1 Quercus robur POK Botanical name

data(lookup_df) works, it was previously called data(sp_lookupdf) but now there is nothing listed in the package under sp_lookupdf so I wonder if you have a previous version of the package installed, did you run

detach(WoodlandCarbonCode) remove.packages("WoodlandCarbonCode") devtools::install_github("izaopenshaw/WoodlandCarbonCode", force = TRUE) # force = TRUE to install updates

gistin commented 3 weeks ago

it now seem to be totally failing to install. Wouldn't be surprised if its my R mucking up. I may need a reinstall!

gistin commented 3 weeks ago

Ah found the issue. It seem that allodb is called somewhere in the code, but possibly not specific. So this was throwing lots out, My clean version of r didn't have allodb. We probably need to specify it?

izaopenshaw commented 3 weeks ago

ah yes i had been meaning to do this. Specified in imports description file

izaopenshaw commented 3 weeks ago

i'm not sure if this will work as each of the packages require these commands to install them: remotes::install_github('ropensci/allodb') install.packages('BIOMASS',dependencies = TRUE)

gistin commented 3 weeks ago

Not sure either, as you say its called from github. If it is needed (not sure where it's used), then maybe just add to the readme (installation). Presently BIOmass is not called, but somewhere allodb is (this can be just in the documentation and it will still throw something off).

izaopenshaw commented 3 weeks ago

now listed in optional imports of description file and added the commands to install if its not installed within the functions for each