4

After looking at all the related post, I have yet to find an acceptable working solution. Thus, I decided to try and ask again!

Error in mutate_impl(.data, dots) : Evaluation error: Only year, quarter, month, week, and day periods are allowed for an index of class Date

test_long$Date <- as.Date(test_long$Date, "%m-%d-%Y")

test_long %>% + time_decompose(count) %>% + anomalize(remainder) %>% + time_recompose() %>% + plot_anomalies(time_recomposed = TRUE, ncol=3, alpha_dots = 0.25)

Note: Index not ordered. tibbletime assumes index is in ascending order. Results may not be as desired.

Error in mutate_impl(.data, dots) : Evaluation error: Only year, quarter, month, week, and day periods are allowed for an index of class Date.

str(test_long$Date) Date[1:5719], format: "2016-01-27" "2016-01-28" "2016-01-29" "2016-01-30" "2016-01-31" "2016-02-01" "2016-02-02" "2016-02-03" "2016-02-04" "2016-02-05" "2016-02-06" ...

I apologize in advance if this post isn't sufficiently clear. This is my first post.

Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55
Sun
  • 49
  • 4
  • Can you post your code? – rick Jun 05 '18 at 13:45
  • test_long <- as.data.frame(data %>% group_by(date,acc_id) %>% summarise(count = as.numeric(n_distinct(d_id))) %>% ungroup()) test_long$acc_id <- as.character(test_long$acc_id) test_long <- test_long %>% tibbletime::as_tbl_time(index = date) test_long %>% time_decompose(count) %>% anomalize(remainder) %>% time_recompose() %>% plot_anomalies(time_recomposed = TRUE, ncol=3, alpha_dots=0.25) – Sun Jun 05 '18 at 14:08

0 Answers0