Description Usage Arguments Examples
View source: R/gran_quantile.R
compute distances and groups from algorithm based on raw distributions
1 2 3 4 5 6 7 8 |
.data |
a tsibble |
gran1 |
one granularity e.g. hour_day, day_week, wknd_wday |
gran2 |
one granularity distinct from gran1 |
response |
measured variable |
quantile_prob_val |
values of probability for which distances between quantiles would be computed |
group |
NULL if quantiles to be obtained for the key variable and the column name of the group variable if quantiles to be obtained for the group. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(gravitas)
library(tidyverse)
sm <- smart_meter10 %>%
filter(customer_id %in% c("10006704", "10017936","10006414", "10018250"))
gran1 = "hour_day"
gran2 = NULL
response = "general_supply_kwh"
dist_gran(sm, "hour_day")
dist_gran(sm, "month_year")
sm %>% quantile_gran(gran1 = "hour_day")
group = tibble(customer_id = c("10006704", "10017936", "10006414", "10018250"), group = c(1,2,1,1))
sm_group <- sm %>% left_join(group)
.data <- sm
quantile_gran(sm_group, gran1, group = "group") # obtain quantiles for group
quantile_gran(sm, gran1, group = NULL) # obtain quantiles for customer
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.