re2mgcv {buildmer}R Documentation

Convert lme4 random-effect terms to mgcv 're' smooths

Description

Convert lme4 random-effect terms to mgcv 're' smooths

Usage

re2mgcv(formula, data, drop = TRUE)

Arguments

formula

The lme4 formula.

data

The data.

drop

Logical indicating whether constant, non-intercept columns should be dropped. Default TRUE. A warning is issued if a column needed to be dropped. Note that repeated intercept columns are silently merged without a warning.

Examples

library(buildmer)
re <- re2mgcv(temp ~ angle + (1|replicate) + (1|recipe),lme4::cake)
model <- buildgam(re$formula,re$data)
# note: the below does NOT work, as the dependent variable is looked up in the data by name!

re <- re2mgcv(log(Reaction) ~ Days + (Days|Subject),lme4::sleepstudy)

[Package buildmer version 2.11 Index]