Description Usage Arguments Value Examples
Title Compute distances based on wpd Computes distances between subjects based on wpd across different granularities
1 |
.data |
a tsibble |
harmony_tbl |
a harmony table |
response |
measured variable |
nperm |
number of permutations for normalization |
returns an object of class "dist"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | library(gravitas)
library(tidyverse)
library(parallel)
library(tsibble)
library(rlang)
sm <- smart_meter10 %>%
filter(customer_id %in% c("10006704", "10017936", "10006414", "10018250"))
gran1 <- "hour_day"
gran2 <- NULL
harmonies <- sm %>%
harmony(
ugran = "year",
filter_in = "wknd_wday",
filter_out = c("hhour", "fortnight", "quarter", "semester")
)
harmonies1 <- harmonies %>% mutate(facet_variable = NA)
h <- harmonies1 %>%
select(-facet_levels) %>%
distinct() %>%
mutate(facet_levels = NA) %>%
filter(x_variable %in% c("month_year", "hour_day", "wknd_wday"))
v <- dist_wpd(sm, harmony_tbl = h)
v
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.