Consider changing the plot = plot.new() to plot = NULL or removing it altogether. When using in a non interactive environment (such as a Shiny app), this can run into issues with plot devices since 'plot.new()' interactively builds a plot.
The current workaround is to set plot = TRUE in the function call and then just never use the plot in your code but it would be cleaner to change this in the code directly.
Line 287 - 291 of vec_anom_detection.R (and similarly in ts) is:
Consider changing the
plot = plot.new()
toplot = NULL
or removing it altogether. When using in a non interactive environment (such as a Shiny app), this can run into issues with plot devices since 'plot.new()' interactively builds a plot.The current workaround is to set
plot = TRUE
in the function call and then just never use the plot in your code but it would be cleaner to change this in the code directly.