Fix garbled hc_freq_by_year_ci examples
Change-Id: Iea1dbd8224de732c1b527e217ad945759a6e6bb5
diff --git a/R/hc_freq_by_year_ci.R b/R/hc_freq_by_year_ci.R
index 08ae695..2b54cb3 100644
--- a/R/hc_freq_by_year_ci.R
+++ b/R/hc_freq_by_year_ci.R
@@ -21,15 +21,14 @@
#' @examples
#' \dontrun{
#'
-#' year <- c(1990:2018)}
-#' alternatives <- c("macht []{0,3} Sinn", "ergibt []{0,3} Sinn")}\dontshow{alternatives <- c("macht []{0,3} Sinn")}
+#' year <- c(1990:2018)
+#' alternatives <- c("macht []{0,3} Sinn", "ergibt []{0,3} Sinn")
#' new("KorAPConnection", verbose = TRUE) %>%
#' frequencyQuery(query = alternatives,
#' vc = paste("textType = /Zeit.*/ & pubDate in", year),
#' as.alternatives = TRUE) %>%
#' hc_freq_by_year_ci(as.alternatives = TRUE)
#'
-#' \dontrun{
#'
#' kco <- new("KorAPConnection", verbose = TRUE)
#' expand_grid(
diff --git a/man/hc_freq_by_year_ci.Rd b/man/hc_freq_by_year_ci.Rd
index df2a1b7..e8e560e 100644
--- a/man/hc_freq_by_year_ci.Rd
+++ b/man/hc_freq_by_year_ci.Rd
@@ -30,6 +30,32 @@
\strong{Warning:} This function may be moved to a new package.
}
+\examples{
+\dontrun{
+
+year <- c(1990:2018)
+alternatives <- c("macht []{0,3} Sinn", "ergibt []{0,3} Sinn")
+new("KorAPConnection", verbose = TRUE) \%>\%
+ frequencyQuery(query = alternatives,
+ vc = paste("textType = /Zeit.*/ & pubDate in", year),
+ as.alternatives = TRUE) \%>\%
+ hc_freq_by_year_ci(as.alternatives = TRUE)
+
+
+kco <- new("KorAPConnection", verbose = TRUE)
+expand_grid(
+ condition = c("textDomain = /Wirtschaft.*/", "textDomain != /Wirtschaft.*/"),
+ year = (2005:2011)
+) \%>\%
+ cbind(frequencyQuery(
+ kco,
+ "[tt/l=Heuschrecke]",
+ paste0(.$condition, " & pubDate in ", .$year)
+ )) \%>\%
+ hc_freq_by_year_ci()
+}
+
+}
\seealso{
Other highcharter-helpers:
\code{\link{hc_add_onclick_korap_search}()}