ls_by_class: get functions in the environment by their class. Useful to...

Description Usage Arguments Examples

View source: R/shorthands.R

Description

get functions in the environment by their class. Useful to find e.g. all regression models you've stored in interactive programming.

Usage

1
ls_by_class(classes, envir = parent.frame(), top_class_only = FALSE, ...)

Arguments

classes

objects should have one of these classes

envir

defaults to looking in the calling environment of this function, passed to ls

top_class_only

defaults to FALSE. If false, also returns objects inheriting from one of the specified classes.

...

passed to ls

Examples

1
2
3
4
5
data(ChickWeight)
chickweight.m1 <- glm(weight ~ Time + Diet, family = gaussian, data = ChickWeight)
ls_by_class('lm')
c('chickweight.m1') %in% ls_by_class('lm')
c('chickweight.m1') %in% ls_by_class('lm', top_class_only = TRUE)

grebbel/formr_test documentation built on May 17, 2019, 8:34 a.m.