Learn R Programming

glmmboot (version 0.6.0)

get_rand: Takes in a formula with bars and gives back the plain names of the columns

Description

Takes in a formula with bars and gives back the plain names of the columns

Usage

get_rand(form_with_bars)

Arguments

form_with_bars

A formula used in e.g. lme4 and similar packages. Typically along the lines: y ~ age + (1 | school) etc

Value

A vector of the variables that are treated as random.

Examples

Run this code
# NOT RUN {
get_rand("y ~ age + (1 | school)")
get_rand("y ~ income + (1 | school) + (1 | school:section)")
get_rand("y ~ income + (1 | school) + (1 | school/section)")
get_rand(as.formula("y ~ x + (1 | z)"))
get_rand("y ~ x")

# }

Run the code above in your browser using DataLab