diff --git a/DESCRIPTION b/DESCRIPTION index a589a46..bb4679c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tsbox Type: Package Title: Class-Agnostic Time Series -Version: 0.4.1 +Version: 0.4.1.9001 Authors@R: c( person("Christoph", "Sax", email = "christoph.sax@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7192-7044")), person("Cathy", "Chamberlin", role = c("rev")), diff --git a/NEWS.md b/NEWS.md index 1fdd9ec..2df653c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# tsbox 0.4.1.9001 + +- ts_ggplot: pass symbols, not strings (fix #223) + + # tsbox 0.4.1 (2023-05-06) ## Bug fixes diff --git a/R/ts_ggplot.R b/R/ts_ggplot.R index b807180..b6a21e4 100644 --- a/R/ts_ggplot.R +++ b/R/ts_ggplot.R @@ -67,10 +67,13 @@ ts_ggplot <- function(..., title, subtitle, ylab = "") { n <- NCOL(df) stopifnot(n > 1L) + stime <- as.name(cname$time) + svalue <- as.name(cname$value) + if (n == 2L) { p <- ggplot2::ggplot( df, - ggplot2::aes(x = !! cname$time, y = !! cname$value) + ggplot2::aes(x = !! stime, y = !! svalue) ) } else if (n > 2) { @@ -87,7 +90,7 @@ ts_ggplot <- function(..., title, subtitle, ylab = "") { } p <- ggplot2::ggplot( df, - ggplot2::aes(x = !! cname$time, y = !! cname$value, color = cname$id) + ggplot2::aes(x = !! stime, y = !! svalue) ) } p <- p + ggplot2::geom_line()