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

input of length>1 is not accepted for B_SOILCLASS_USDA? #24

Open
JobdePater opened this issue Apr 28, 2023 · 2 comments
Open

input of length>1 is not accepted for B_SOILCLASS_USDA? #24

JobdePater opened this issue Apr 28, 2023 · 2 comments
Assignees

Comments

@JobdePater
Copy link
Contributor

soilptf/R/cec.R

Line 3320 in ec8fc52

dt[B_SOILCLASS_USDA == 'alfisol', value := -0.328 + 0.059 * A_PH_WA^3]

@JobdePater
Copy link
Contributor Author

not sure if its an error but this message appears when running the function:

Error in[.data.table(dt, B_SOILCLASS_USDA == "alfisol", :=(value, : Supplied 2 items to be assigned to 1 items of column 'value'. If you wish to 'recycle' the RHS please use rep() to make this intent clear to readers of your code.

@gerardhros
Copy link
Collaborator

do you have a reproducable example?

All these examples give an answer :

  • sptf_cec74(45,7.5,45,8.5,'alfisol')
  • sptf_cec74(45,7.5,45,8.5,NA_real_)
  • sptf_cec74(c(45,35),c(7.5,5),c(45,15),c(8.5,4.9),c(NA_real_,NA_real_))
  • sptf_cec74(c(45,35),c(7.5,5),c(45,15),c(8.5,4.9),rep('alfisol',2))

All arguments must have the same length.

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

No branches or pull requests

2 participants