Add as.alternative parameter to frequencyQuery method
And also rename "tokens" to the more generic "total" in the result
tibble.
Change-Id: Iae2ec16307f993e5b95792f2f66c6a38dc9ff67d
diff --git a/man/ci.Rd b/man/ci.Rd
index 381adb0..ee6e18d 100644
--- a/man/ci.Rd
+++ b/man/ci.Rd
@@ -4,7 +4,7 @@
\alias{ci}
\title{Add confidence interval and relative frequency variables}
\usage{
-ci(df, x = totalResults, N = tokens, conf.level = 0.95)
+ci(df, x = totalResults, N = total, conf.level = 0.95)
}
\arguments{
\item{df}{table with columns for absolute and total frequencies.}
@@ -27,7 +27,7 @@
kco <- new("KorAPConnection", verbose=TRUE)
expand_grid(year=2015:2018, alternatives=c("Hate Speech", "Hatespeech")) \%>\%
bind_cols(corpusQuery(kco, .$alternatives, sprintf("pubDate in \%d", .$year))) \%>\%
- mutate(tokens=corpusStats(kco, vc=vc)$tokens) \%>\%
+ mutate(total=corpusStats(kco, vc=vc)$tokens) \%>\%
ci() \%>\%
ggplot(aes(x=year, y=f, fill=query, color=query, ymin=conf.low, ymax=conf.high)) +
geom_point() + geom_line() + geom_ribbon(alpha=.3)