Skip to content

Commit e5c596b

Browse files
committed
added check for correct type of the input parameter na.rm
1 parent 1618df3 commit e5c596b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

R/ts_anom_detection.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos',
8383
colnames(x) <- c("timestamp", "count")
8484
}
8585

86+
if(!is.logical(na.rm)){
87+
stop("na.rm must be either TRUE (T) or FALSE (F)")
88+
}
89+
8690
# Deal with NAs in timestamps
8791
if(any(is.na(x$timestamp))){
8892
if(na.rm){

0 commit comments

Comments
 (0)