check_newdata {invivoPKfit} | R Documentation |
Check new data
Description
Check new data to ensure it has the required variables and classes
Usage
check_newdata(newdata, olddata, req_vars, exclude = FALSE)
Arguments
newdata |
A 'data.frame' containing new data |
olddata |
A 'data.frame' containing existing data. 'newdata' variable classes will be required to match 'olddata' |
req_vars |
A 'character' vector of required variable names that must appear in 'newdata' |
exclude |
Logical: Whether a variable '"exclude"' also must be present in 'newdata' |
Details
This is a helper function to check new data to ensure it has the required variables and that those variables are of the correct classes. This is useful, for example, when making predictions from a fitted [pk()] model object on new data.
Value
'TRUE', if required variables are present in 'newdata', and required variables are of the same class in 'newdata' and 'olddata'. Otherwise, this function will stop with an error.
Author(s)
Caroline Ring