Description Usage Arguments Value See Also
View source: R/gen_data_utils.R
Given spatio-temporal data, transform it into a data frame where each row has its own value as target variable and, as predictors, lagged values recorded in the past at its own location and/or in the past at neighbouring locations.
1 | st_lag_neib_ord1(data, neibs, p, slags)
|
data |
a matrix of spatio-temporal data where each row contains the variable information for a time point and each column corresponds to a certain location |
neibs |
a data frame with information about the
neighbours, like the one returned by |
p |
a number for the order of the temporal lag for values at a specific location |
slags |
a vector with the length of the order of temporal lags for values at immediately neighbouring locations. A value of 0 means no neighbours are used at that temporal lag, a value of 1 means that the values of immediate neighbours are included for that temporal lag. |
a data frame with columns time, site, target,
as many self_lag columns as p
, and as many
top, bottom, right and left neighbour value lags as the
sum of slags
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.