From c1dbd64b781a882a5d8a919d742a75e1c5127f9d Mon Sep 17 00:00:00 2001 From: thoenis Date: Thu, 31 Jan 2019 17:09:05 +0100 Subject: [PATCH] Allow time series of length 1 in barplots closes #280 --- R/tsplot.R | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/R/tsplot.R b/R/tsplot.R index 0721da9..6ea15f7 100644 --- a/R/tsplot.R +++ b/R/tsplot.R @@ -282,7 +282,7 @@ tsplot.list <- function(..., } tsl_lengths <- sapply(tsl, length) - if(any(tsl_lengths == 1)) { + if(any(tsl_lengths == 1) && !left_as_bar) { warning("tsl contains series of length 1! Omitting those.") tsl <- tsl[tsl_lengths > 1] if(length(tsl) == 0) { @@ -310,10 +310,6 @@ tsplot.list <- function(..., } } - if(any(sapply(tsl, length) == 1) || (!is.null(tsr) && any(sapply(tsr, length) == 1))) { - stop("Time series of length 1 are not supported!") - } - if(is.null(theme)) { if(output_format != "plot") { theme <- init_tsplot_print_theme()