cov_names_in_data: Covariate names that are columns of the data

View source: R/utility.R

cov_names_in_dataR Documentation

Covariate names that are columns of the data

Description

all.vars() on a model formula returns every symbol in it, including objects a smooth refers to through its xt argument – the mesh of an SPDE field, say – which are not covariates and are not columns of the data. Those have to be dropped before the data are indexed by name.

Usage

cov_names_in_data(var_names, data)

Arguments

var_names

Character vector of names found in the formulas

data

Data frame

Details

A covariate that is genuinely missing from the data is dropped here too, rather than raising an error. mgcv::gam() reports it when the design matrices are built, which is a better place to say so.

Value

The subset of var_names naming columns of data


hmmTMB documentation built on Nov. 10, 2026, 5:09 p.m.