business-science / anomalize

Tidy anomaly detection
https://business-science.github.io/anomalize/
339 stars 61 forks source link

plot_anomaly_decomposition() - Error in -x : invalid argument to unary operator #6

Closed amrrs closed 6 years ago

amrrs commented 6 years ago

Looks like a problem with this particular function ggplot ones?

> library(anomalize)
Warning messages:
1: R graphics engine version 12 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed. 
2: package ‘anomalize’ was built under R version 3.4.4 
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

Warning message:
package ‘dplyr’ was built under R version 3.4.2 
> library(ggplot2)
Warning message:
package ‘ggplot2’ was built under R version 3.4.2 
> tidyverse_cran_downloads %>%
+     filter(package == "lubridate") %>%
+     ungroup() %>%
+     time_decompose(count) %>%
+     anomalize(remainder) %>%
+     plot_anomaly_decomposition() +
+     labs(title = "Decomposition of Anomalized Lubridate Downloads")
Converting from tbl_df to tbl_time.
Auto-index message: index = date
frequency = 7 days
trend = 91 days
Error in -x : invalid argument to unary operator
In addition: Warning message:
package ‘bindrcpp’ was built under R version 3.4.1