Description Usage Arguments Value Examples
prepare high & low values for time series
1 | Predict.interval (df, loc, ind, kpi, periods, interval.width)
|
df |
dataframe which have to include the next columns: scenario, year, value |
loc |
name of location where we create interval |
ind |
name of industry where we create interval |
kpi |
name of indicator which we create interval |
periods |
the number of months |
interval.width |
the size from 0.7 till 0.99 |
dataframe
1 2 3 4 5 6 7 8 9 10 11 12 | num_loc <- distinct(data_10, location) %>% arrange(location) %>% rowid_to_column() %>% mutate(total = nrow(.))
num_ind <- distinct(data_10, industry) %>% arrange(industry ) %>% rowid_to_column() %>% mutate(total = nrow(.))
num_kpi <- distinct(data_10, indicator) %>% arrange(indicator) %>% rowid_to_column() %>% mutate(total = nrow(.))
data_1 <- data_10 %>%
nest_by(location,indicator,industry) %>%
mutate(data = list(Prediction_interval(data,
loc = num_loc[grepl(location , num_loc$location ),],
ind = num_ind[grepl(industry , num_ind$industry ),],
kpi = num_kpi[grepl(indicator, num_kpi$indicator ),]))) %>%
unnest(data) %>% ungroup() %>%
mutate(year = as.integer(year),
value = ifelse (value<0,0,value))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.