data <- data.frame(tmin.l1 = rnorm(10), pdsi.l1 = rnorm(10))
covs <- extract_names(data, pattern = c("tmin", "pdsi"))
covlist <- cov_multi(covs, pattern = c("tmin", "pdsi"))
# Apply varying effect to tmin
cov_varying(covlist, pattern = "tmin", unit = "spat_id")
# Keep original and add varying effect terms
cov_varying(covlist, pattern = "tmin", unit = "spat_id", add = TRUE)
Run the code above in your browser using DataLab