Skip to content

Commit 1b69f09

Browse files
author
Reno Reckling
committed
fix bug for data_sigma check
1 parent 1f5deaa commit 1b69f09

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

R/detect_anoms.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ detect_anoms <- function(data, k = 0.49, alpha = 0.05, num_obs_per_period = NULL
8787

8888
# protect against constant time series
8989
data_sigma <- func_sigma(data[[2L]])
90-
if(data_sigma == 0)
90+
if(is.na(data_sigma) || data_sigma == 0)
9191
break
9292

9393
ares <- ares/data_sigma

0 commit comments

Comments
 (0)