Description Usage Arguments Value Examples
View source: R/data_handling.R
Let data in low resolution be given (e.g. monthly, quarterly). This is then matched to a high resolution (e.g. daily) and the corresponding entries are copied.
1 | completeLowResolutionData(date_target, df, by_column = "Date")
|
date_target |
Time series of desired output (high resolution). |
df |
Data frame with the low resolution data. |
by_column |
String which identifies the date column in |
Returns data frame with copied entries. The response is sorted in chronological order.
1 2 3 4 5 6 7 8 9 10 11 12 | ts <- data.frame(Date = seq(from = as.Date("2000-01-01"), to = as.Date("2000-03-31"), by = "1 day"))
df_monthly <- data.frame(Month = c(as.Date("2000-01-31"),
as.Date("2000-02-29"),
as.Date("2000-03-31")),
Values = 1:3)
df_daily <- completeLowResolutionData(ts$Date, df_monthly, "Month")
# example of how to bind things together
library(dplyr)
ts <- ts %>%
left_join(df_daily, by = c("Date" = "Month"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.