View source: R/hc_freq_by_year_ci.R
hc_freq_by_year_ci | R Documentation |
Convenience function for plotting typical frequency by year graphs with confidence intervals using highcharter.
Warning: This function may be moved to a new package.
hc_freq_by_year_ci(
df,
as.alternatives = FALSE,
ylabel = if (as.alternatives) "%" else "ipm",
smooth = FALSE,
...
)
df |
data frame like the value of a |
as.alternatives |
boolean decides whether queries should be treated as mutually exclusive and exhaustive wrt. to some meaningful class (e.g. spelling variants of a certain word form). |
ylabel |
defaults to |
smooth |
boolean decides whether the graph is smoothed using the highcharts plot types spline and areasplinerange. |
... |
additional arguments passed to |
A highchart htmlwidget object containing the frequency plot.
Other highcharter-helpers:
hc_add_onclick_korap_search()
## Not run:
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()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.