Description Usage Arguments Examples
Trims an R object whilst presuming the results of a given function call,
where the R object is given as an argument. One popular example could be
trimming an R model object whilst presuming the results of the
predict
function on a sample of data.
1 2 3 |
obj |
|
obj_arg_name |
|
fun |
|
size_target |
|
tolerate_warnings |
|
verbose |
|
dont_touch |
|
... |
other (named) arguments for 'fun'. |
1 2 3 4 5 6 7 8 | # get training data for predictive model.
trn <- datasets::mtcars
# estimate model.
mdl <- lm(mpg ~ ., data = trn)
trim(obj = mdl, obj_arg_name = "object", fun = predict, newdata = trn)
trim(obj = mdl, obj_arg_name = "object", fun = predict, newdata = trn,
dont_touch = list(c("model"), c("qr","tol")))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.