Add confidence level argument to frequencyQuery
Change-Id: I2ca64e8a5aa7027c46382d2531e32f0d672c9810
diff --git a/R/KorAPQuery.R b/R/KorAPQuery.R
index 9894d87..bd704d5 100644
--- a/R/KorAPQuery.R
+++ b/R/KorAPQuery.R
@@ -303,12 +303,13 @@
#'
#' @param kco \code{\link{KorAPConnection}} object (obtained e.g. from \code{new("KorAPConnection")}
#' @param query string that contains the corpus query. The query language depends on the \code{ql} parameter. Either \code{query} must be provided or \code{KorAPUrl}.
+#' @param conf.level confidence level of the returned confidence interval (passed throgh \code{\link{ci}} to \code{\link{prop.test}}).
#' @export
setMethod("frequencyQuery", "KorAPConnection",
- function(kco, query, vc = "", ...) {
- corpusQuery(kco, query, vc, metadataOnly = TRUE, as.df=TRUE, ...) %>%
+ function(kco, query, vc = "", conf.level = 0.95, ...) {
+ corpusQuery(kco, query, vc, metadataOnly = TRUE, as.df = TRUE, ...) %>%
mutate(tokens=corpusStats(kco, vc=vc, as.df=TRUE)$tokens) %>%
- ci()
+ ci(conf.level = conf.level)
})
#´ format()
diff --git a/man/KorAPQuery-class.Rd b/man/KorAPQuery-class.Rd
index 2a1fa8b..2f343f6 100644
--- a/man/KorAPQuery-class.Rd
+++ b/man/KorAPQuery-class.Rd
@@ -33,7 +33,8 @@
\S4method{fetchRest}{KorAPQuery}(kqo,
verbose = kqo@korapConnection@verbose)
-\S4method{frequencyQuery}{KorAPConnection}(kco, query, vc = "", ...)
+\S4method{frequencyQuery}{KorAPConnection}(kco, query, vc = "",
+ conf.level = 0.95, ...)
\method{format}{KorAPQuery}(x, ...)
@@ -76,6 +77,8 @@
\item{query}{string that contains the corpus query. The query language depends on the \code{ql} parameter. Either \code{query} must be provided or \code{KorAPUrl}.}
+\item{conf.level}{confidence level of the returned confidence interval (passed throgh \code{\link{ci}} to \code{\link{prop.test}}).}
+
\item{...}{further arguments passed to or from other methods}
\item{x}{KorAPQuery object}