AgroCares / Open-Bodem-Index-Calculator

An R package containing the functions for the Open Bodem Index (OBI)
https://agrocares.github.io/Open-Bodem-Index-Calculator/
GNU General Public License v3.0
11 stars 2 forks source link

unusefull error message in obic_field_dt() #147

Closed BrentWHR closed 3 years ago

BrentWHR commented 3 years ago

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

BrentWHR commented 3 years ago

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