ptompalski / MISTR

Implementation of Ontario's growth and yield models
8 stars 1 forks source link

Issue with finding Forest Unit Co-efficients #2

Closed Kloukes closed 3 years ago

Kloukes commented 3 years ago

Hello, I am encountering an error when trying to use any forest units that are listed in the coefficient table that have camel-case names.

eg. If I try to calculate GTV using the following: GTV_var <- calc_GTV(BA = 16.67 , H =18.84 , SppId ="ConMx", Origin = "N", PlantedSpp = NA)

I encounter this error: Error in if (!(SppID_GTV %in% coeffs$SppId)) { : argument is of length zero

This is occurring for just these forest units: image

ptompalski commented 3 years ago

Thanks for reporting this. Indeed function calc_GTV does not work with some forest units, however, the reason is not the camel-case. The model coefficients are selected using the MISTR_coef$species_model_selection table, which does not contain all of the species/forest unit ids.

I think I already know what the solution is, will try to update the package over the weekend.

ptompalski commented 3 years ago

Should be fixed now, but please check!

Kloukes commented 3 years ago

It is working fine now - Thank you!