AddFormulaBars: Add random effects terms to a model formula

View source: R/addformulabars.R

AddFormulaBarsR Documentation

Add random effects terms to a model formula

Description

Replaces factor variables in a formula with their representation as a random effect (e.g. a factor f becomes (1|f)) as done for formulas in e.g. the lme4 and nlme packages.

Usage

AddFormulaBars(frml, data)

Arguments

frml

A model formula.

data

A data.frame containing the variables in frml.

Details

A formula with one factor f and one continuous variable c in the formula

Examples

dat <- data.frame(c1 = 1:3, c2 = rnorm(3), f1 = factor(1:3), f2 = ordered(1:3))
frml <- ~c1+c2+f1+f2
AddFormulaBars(frml, dat)

Displayr/flipData documentation built on March 2, 2024, 3:49 a.m.