JanaJarecki / cognitivemodels

Cognitivemodels is an open-source R library to create, fit, test, and compare computational cognitive models based on machine-learning principles.
25 stars 4 forks source link

Descriptive error message if LHS and RHS of formula are switched? #62

Open FlorianSeitz opened 4 years ago

FlorianSeitz commented 4 years ago

https://github.com/JanaJarecki/cognitivemodels/blob/dd3ab9757f1c25a5373f8acd29fe5a841165d6a6/tests/testthat/test_ebmj.R#L202

To date we have the following error: Error in private$get_input(f = self$formulaCriterion, d = d, na.action = NULL) : Can't find variables from 'formula' in 'data': [c].

Maybe we could add an error stating that the LHS of the formula should only contain one variable (e.g., stating that the user might have switched the LHS and the RHS)?