Learn R Programming

RKorAPClient (version 0.5.9)

geom_freq_by_year_ci: Experimental: Plot frequency by year graphs with confidence intervals

Description

Experimental convenience function for plotting typical frequency by year graphs with confidence intervals using ggplot2. Warning: This function may be moved to a new package.

Usage

geom_freq_by_year_ci(mapping = aes(ymin = conf.low, ymax = conf.high), ...)

Arguments

mapping

Set of aesthetic mappings created by aes() or aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.

...

Other arguments passed to geom_ribbon, geom_line, and geom_click_point.

Examples

Run this code
# NOT RUN {
library(ggplot2)
kco <- new("KorAPConnection", verbose=TRUE)
# }
# NOT RUN {
expand_grid(condition = c("textDomain = /Wirtschaft.*/", "textDomain != /Wirtschaft.*/"),
            year = (2005:2011)) %>%
  cbind(frequencyQuery(kco, "[tt/l=Heuschrecke]",
                            paste0(.$condition," & pubDate in ", .$year)))  %>%
  ipm() %>%
  ggplot(aes(year, ipm, fill = condition, color = condition)) +
  geom_freq_by_year_ci()
# }

Run the code above in your browser using DataLab