Description Usage Arguments Value Examples
View source: R/parse_time_series.R
Function to transfer data frame with time series values in wide format to format accepted by 'line_chart_dense_custom'.
1 | parse_time_series(df, dates, series, convert.to = "months")
|
df |
Date frame with data in wide format. |
dates |
Name of column in 'df' which contains dates. |
series |
Vector of column names in 'df' with values of time series. |
convert.to |
Granularity of x axis. One of c('weeks', 'months', 'quarters', 'years'). Default value is 'months'. |
list of data frames, each one containing data about one time series. Data frames in returned list consist of columns: * containing numeric values from 0 to 100 defining the percentage of distance in one time interval of the point (x - coordinates of the point) * containing the value of a point (y - coordinates of the point) * containing the time interval of the value
1 2 3 4 5 | df <- data.frame(
dates = as.Date(c('2021-07-12', '2021-06-18', '2021-05-12')),
val1 = c(1.5, 1.2, 2.1),
val2 = c(0.9, 3.2, 1.1))
parse_time_series(df, 'dates', c('val1', 'val2'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.