| cov_names_in_data | R Documentation |
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.
cov_names_in_data(var_names, data)
var_names |
Character vector of names found in the formulas |
data |
Data frame |
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.
The subset of var_names naming columns of data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.