Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

When plot = FALSE, don't call plot.new #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/ts_anom_detection.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos',
# If there are no anoms, then let's exit
if(anom_pct == 0){
if(verbose) message("No anomalies detected.")
return (list("anoms"=data.frame(), "plot"=plot.new()))
return (list("anoms"=data.frame(), "plot"=NULL))
}

if(plot){
Expand Down Expand Up @@ -359,6 +359,6 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos',
if(plot){
return (list(anoms = anoms, plot = xgraph))
} else {
return (list(anoms = anoms, plot = plot.new()))
return (list(anoms = anoms, plot = NULL))
}
}
4 changes: 2 additions & 2 deletions R/vec_anom_detection.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ AnomalyDetectionVec = function(x, max_anoms=0.10, direction='pos',
# If there are no anoms, then let's exit
if(anom_pct == 0){
if(verbose) message("No anomalies detected.")
return (list("anoms"=data.frame(), "plot"=plot.new()))
return (list("anoms"=data.frame(), "plot"=NULL))
}

if(plot){
Expand Down Expand Up @@ -287,6 +287,6 @@ AnomalyDetectionVec = function(x, max_anoms=0.10, direction='pos',
if(plot){
return (list(anoms = anoms, plot = xgraph))
} else {
return (list(anoms = anoms, plot = plot.new()))
return (list(anoms = anoms, plot = NULL))
}
}