Add some parameters' documentation and examples
Change-Id: Ib1eb1d9a98e8eae12f4c42fc4cea38c1c118a731
diff --git a/man/KorAPQuery.Rd b/man/KorAPQuery.Rd
index cfe7e4f..1f50a83 100644
--- a/man/KorAPQuery.Rd
+++ b/man/KorAPQuery.Rd
@@ -5,7 +5,8 @@
\title{Send a query to a KorAP connection.}
\usage{
KorAPQuery(con, query, vc = "", KorAPUrl, metadataOnly = TRUE,
- ql = "poliqarp", fields = defaultFields, accessRewriteFatal = TRUE)
+ ql = "poliqarp", fields = defaultFields, accessRewriteFatal = TRUE,
+ verbose = FALSE)
}
\arguments{
\item{con}{object obtained from \code{\link{KorAPConnection}}, that contains all necessary connection information}
@@ -21,6 +22,10 @@
\item{ql}{string to choose the query language (see \href{https://github.com/KorAP/Kustvakt/wiki/Service:-Search-GET#user-content-parameters}{section on Query Parameters} in the Kustvakt-Wiki for possible values.}
\item{fields}{(meta)data fields that will be fetched for every match}
+
+\item{accessRewriteFatal}{abort if query or given vc had to be rewritten due to insufficent rights (not yet implemented)}
+
+\item{verbose}{print some info}
}
\value{
A KorAP query object that, among other information, contains the total number of results in \code{$meta$totalResults}. The resulting object can be used to fetch all query results (with \code{\link{KorAPFetchAll}}) or the next page of results (with \code{\link{KorAPFetchNext}}).
@@ -40,6 +45,14 @@
KorAPUrl = "https://korap.ids-mannheim.de/?q=Ameise&cq=pubDate+since+2017&ql=poliqarp")
q$meta$totalResults
+q <- KorAPQuery(con, "Ameisenplage")
+q <- KorAPFetchAll(q, verbose=TRUE)
+tokensPerYear <- function(year) { return(KorAPCorpusStats(con, paste("pubDate in", year))$tokens) }
+df <- as.data.frame(table(as.numeric(format(q$collectedMatches$pubDate,"\%Y")), dnn="year"),
+ stringsAsFactors = FALSE)
+df$ipm <- 1000000 * df$Freq / tokensPerYear(df$year)
+plot(df$year, df$ipm, type="l")
+
}
\references{
\url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026}