-
Notifications
You must be signed in to change notification settings - Fork 19
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
get_SDA_interpretation
sometimes throws warning for NCCPI
#315
Comments
get_SDA_interpretation
sometimes throws warning for NCCPI
Hey @kevinwolz This appears to be an unhandled issue with some components that lack ratings for most of the subrules. I am unable to open the attached .RData file. But I can reproduce the issue here with mukey It is 100% higher taxa "Fluvents" and is "Not rated" for anything except "Impacted soil" subrule. The issue above arises because the impacted soil has a numeric rating of zero, whereas the others have "Not rated" reason with no numeric, which creates a non-conformal rbind condition that kinda messes things up with the resulting character matrix. Thanks for pointing this out library(soilDB)
y <- get_SDA_interpretation(
rulename = "NCCPI - National Commodity Crop Productivity Index (Ver 3.0)",
method = "Dominant Component",
mukeys = 459419,
wide_reason = TRUE
)
#> Warning in rbind(c("NCCPI - NCCPI Corn Submodel (I)", "Not rated"), c("NCCPI -
#> NCCPI Small Grains Submodel (II)", : number of columns of result is not a
#> multiple of vector length (arg 1)
y
#> mukey cokey areasymbol musym muname compname
#> 1 459419 24586388 CA041 127 Fluvents, channeled Fluvents
#> compkind comppct_r majcompflag
#> 1 Taxon above family 100 Yes
#> rating_NCCPINationalCommodityCropProductivityIndexVer30
#> 1 NA
#> class_NCCPINationalCommodityCropProductivityIndexVer30
#> 1 Not rated
#> reason_NCCPINationalCommodityCropProductivityIndexVer30
#> 1 NCCPI - NCCPI Corn Submodel (I) "Not rated" (); NCCPI - NCCPI Small Grains Submodel (II) "Not rated" (); NCCPI - NCCPI Cotton Submodel (II) "Not rated" (); NCCPI - NCCPI Soybeans Submodel (I) "Not rated" (); Impacted soil "No limitation" (0)
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_NCCPINCCPICornSubmodelI
#> 1 NCCPI - NCCPI Corn Submodel (I)
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_NCCPINCCPISmallGrainsSubmodelII
#> 1 NCCPI - NCCPI Small Grains Submodel (II)
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_NCCPINCCPICottonSubmodelII
#> 1 NCCPI - NCCPI Cotton Submodel (II)
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_NCCPINCCPISoybeansSubmodelI
#> 1 NCCPI - NCCPI Soybeans Submodel (I)
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_Impactedsoil
#> 1 0 After 1ac18dc I get no warnings but let me know if you find others that have this kind of issue. library(soilDB)
y <- get_SDA_interpretation(
rulename = "NCCPI - National Commodity Crop Productivity Index (Ver 3.0)",
method = "Dominant Component",
mukeys = 459419,
wide_reason = TRUE
)
y
#> mukey cokey areasymbol musym muname compname
#> 1 459419 24586388 CA041 127 Fluvents, channeled Fluvents
#> compkind comppct_r majcompflag
#> 1 Taxon above family 100 Yes
#> rating_NCCPINationalCommodityCropProductivityIndexVer30
#> 1 NA
#> class_NCCPINationalCommodityCropProductivityIndexVer30
#> 1 Not rated
#> reason_NCCPINationalCommodityCropProductivityIndexVer30
#> 1 NCCPI - NCCPI Corn Submodel (I) "Not rated" (); NCCPI - NCCPI Small Grains Submodel (II) "Not rated" (); NCCPI - NCCPI Cotton Submodel (II) "Not rated" (); NCCPI - NCCPI Soybeans Submodel (I) "Not rated" (); Impacted soil "No limitation" (0)
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_NCCPINCCPICornSubmodelI
#> 1 <NA>
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_NCCPINCCPISmallGrainsSubmodelII
#> 1 <NA>
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_NCCPINCCPICottonSubmodelII
#> 1 <NA>
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_NCCPINCCPISoybeansSubmodelI
#> 1 <NA>
#> rating_reason_NCCPINationalCommodityCropProductivityIndexVer30_Impactedsoil
#> 1 0 |
Thanks for the quick response! The mukeys I was working with no work on my end without a warning. |
Great. Closing this, but we can continue fixing any issues with |
I'm using the approach developed in #303 to get NCCPI data.
get_SDA_interpretation
sometimes throws the below warning for me and sometimes not, depending on the specific mukeys passed to it. Attached here is an Rdata file (in the zip file) containing a vector of mukeys that does generate the warning. What's going on here?mukeys.RData.zip
The text was updated successfully, but these errors were encountered: