AgroCares/Open-Bodem-Index-Calculator

unusefull error message in obic_field_dt()

BrentWHR opened this issue · 1 comments

Mandatory columns for the data.table entered in function are checked like this:
`# check input
dt.check <- length(dt.req[dt.req %in% dt.cols]) == 29

check type of dt

checkmate::assert_true(dt.check)If required columns are missing this results in the error message:Error in OBIC::obic_field_dt(obiin) :
Assertion on 'dt.check' failed: Must be TRUE.`

The error message is more usefull if it tells the user which column name is missing

Additionally, dt.check checks for lenght 29 while dt.req is currently 27, making obic_field_dt() unusable.