add.terms: Add terms to a formula

add.termsR Documentation

Add terms to a formula

Description

Add terms to a formula

Usage

add.terms(formula, add)

Arguments

formula

The formula to add terms to.

add

A vector of terms to add. To add terms nested in random-effect groups, use ‘(term|group)’ syntax if you want to add an independent random effect (e.g. ‘(olderterm|group) + (term|group)’), or use ‘term|group’ syntax if you want to add a dependent random effect to a pre-existing term group (if no such group exists, it will be created at the end of the formula).

Value

The updated formula.

Examples

library(buildmer)
form <- Reaction ~ Days + (1|Subject)
add.terms(form,'Days|Subject')
add.terms(form,'(0+Days|Subject)')
add.terms(form,c('many','more|terms','to|terms','(be|added)','to|test'))

cvoeten/buildmer documentation built on March 3, 2023, 3:25 p.m.