Check if Data is Valid for Model Fitting
isValidInput2fit.Rd
This function checks whether the provided data contains all the variables required in the model formula for fitting.
Arguments
- data2fit
The data frame or tibble containing the variables to be used for model fitting.
- formula
The formula specifying the model to be fitted.
Value
TRUE
if all the variables required in the formula are present in data2fit
, otherwise an error is raised.
Examples
data(iris)
formula <- Sepal.Length ~ Sepal.Width + Petal.Length
isValidInput2fit(iris, formula) # Returns TRUE if all required variables are present
#> [1] TRUE