library(dplyr)
library(timetk)
d10_daily <- m4_daily %>% filter(id == "D10")
# --- VECTOR ----
value_std <- standardize_vec(d10_daily$value)
value <- standardize_inv_vec(value_std,
mean = 2261.60682492582,
sd = 175.603721730477)
# --- MUTATE ----
m4_daily %>%
group_by(id) %>%
mutate(value_std = standardize_vec(value))
Run the code above in your browser using DataLab