Skip to content

Commit b9399b2

Browse files
committed
made results consistent for ts_anom_detection
1 parent 877354f commit b9399b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

R/ts_anom_detection.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos',
279279
# If there are no anoms, then let's exit
280280
if(anom_pct == 0){
281281
if(verbose) message("No anomalies detected.")
282-
return (list("anoms"=NULL, "plot"=NULL))
282+
return (list("anoms"=data.frame(), "plot"=plot.new()))
283283
}
284284

285285
if(plot){
@@ -341,6 +341,6 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos',
341341
if(plot){
342342
return (list(anoms = anoms, plot = xgraph))
343343
} else {
344-
return (list(anoms = anoms, plot = NULL))
344+
return (list(anoms = anoms, plot = plot.new()))
345345
}
346346
}

0 commit comments

Comments
 (0)