Skip to content

Commit 9e825d1

Browse files
committed
prevent creating plot window
1 parent 1f5deaa commit 9e825d1

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
@@ -297,7 +297,7 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos',
297297
# If there are no anoms, then let's exit
298298
if(anom_pct == 0){
299299
if(verbose) message("No anomalies detected.")
300-
return (list("anoms"=data.frame(), "plot"=plot.new()))
300+
return (list("anoms"=data.frame(), "plot"=NULL))
301301
}
302302

303303
if(plot){
@@ -359,6 +359,6 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos',
359359
if(plot){
360360
return (list(anoms = anoms, plot = xgraph))
361361
} else {
362-
return (list(anoms = anoms, plot = plot.new()))
362+
return (list(anoms = anoms, plot=NULL))
363363
}
364364
}

0 commit comments

Comments
 (0)