Description Usage Arguments Details Value Examples
View source: R/midas_processing.R
Get last high frequency observations
1 | get_last_n_obs(hf_data, lf_date, n_lags = 1, one_row = TRUE)
|
hf_data |
high frequency data |
lf_date |
low frequency date |
n_lags |
number of lags to add |
one_row |
output representation |
Get last high frequency observations. The function cuts n_lags observations from the table hf_data, that are from the same day or before as the date indicated by lf_date. If one_row is TRUE the result is stacked in a row, otherwise the result is a column.
tsibble with high frequency lags added
1 2 3 4 | hf_data <- tibble::tibble(date = lubridate::ymd("2011-01-01") +
lubridate::days(0:60), observations = rnorm(61))
get_last_n_obs(hf_data, "2011-02-23", n_lags = 7,
one_row = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.