Skip to content

Commit

Permalink
Merge jcpetkovich-dont-call-plot.new-when-plot-is-f
Browse files Browse the repository at this point in the history
  • Loading branch information
isalgueiro committed Nov 24, 2017
2 parents 2406de3 + fd74906 commit 2f862c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/ts_anom_detection.R
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,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 @@ -378,6 +378,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))
}
}

0 comments on commit 2f862c0

Please sign in to comment.