Locate where a specific component of a object might exist within the model object itself. This function is restricted in that only items that can be axed can be found.
Arguments
- x
A model object.
- name
A name associated with model component of interest. This defaults to NULL. Possible components include:
env
,call
,data
,ctrl
, andfitted
.
Examples
lm_fit <- lm(mpg ~ ., data = mtcars)
locate(lm_fit, name = "env")
#> [1] "x$terms"
locate(lm_fit, name = "call")
#> [1] "x$call"