This function biscally adds an option to select time series by the significance of their anomaly specified by the new sig
parameter. It is backward compatible, so shouldn't brake any exsisting code, see below
# Load the anomalous package
library(anomalous)
## Create measures
y <- tsmeasures(dat0, window = 30)
###### Backward compatibility
## Compare default behaviour
identical(anomaly(y, method = "hdr"),
anomaly2(y, method = "hdr"))
## Make sure that if a user specifies n, it behaves as before
n <- 5
identical(anomaly(y, n = n, method = "hdr"),
anomaly2(y, n = n, method = "hdr"))
## Testing new feature
hdr <- anomaly2(y, sig = .15, method = "hdr")