Skip to contents

This function extracts Gaussian process terms denoted using gp() from a formula so that they can be processed on their own.

Usage

gp_terms(formula)

Arguments

formula

A model formula that may use standard fixed effects, random effects using lme4 syntax (see re()), and random walks defined using the rw() helper function. See the Details section below for a comprehensive explanation of the supported syntax.

Value

A character vector containing the Gaussian process terms identified in the supplied formula.

Examples

epinowcast:::gp_terms(~ 1 + age_group + gp(week))
#> [1] "gp(week)"
epinowcast:::gp_terms(~ 1 + gp(week, kernel = "se") + gp(day))
#> [1] "gp(week, kernel = \"se\")" "gp(day)"