Description Usage Arguments Details
View source: R/tempo_wrangle.R
Function for formatting a long form covariate data frame into a suitable format stuiable for tempo.
1 | tempo_wrangle(x, y, vars, n_time_steps = NULL)
|
x |
data.frame; Long form covariate data containing covariate info for
every observation/sample unit at every time step. Must contain a column,
|
y |
data.frame; The observation data containing a column called
|
vars |
vector; a character vector with the column names of the
covariates to be extracted and formatted from |
n_time_steps |
The number of time steps you want to include in the
model. This argument is useful if you have covariate data for every day of
the year (365 time steps), but the event can only occur in the first
n days of the year. In this case, you would specify
|
The function extracts specified covariates (vars
) from a long format
data frame (x
) for a dataset (y
) for use in tempo. Returns
a list of covariate matrices. Rows are named using the y$obs_id
,
columns are named using the time steps in x$time_step
,
and list elements are named for the covariates using the vars
argument.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.