Provide comments for some basic examples
Change-Id: Id2cb29e6244cb7cd8d61184dcc0a3135d92ee354
diff --git a/R/KorAPQuery.R b/R/KorAPQuery.R
index c02b87b..b70718c 100644
--- a/R/KorAPQuery.R
+++ b/R/KorAPQuery.R
@@ -94,15 +94,21 @@
#' Please make sure to check \code{$collection$rewrites} to see if any unforseen access rewrites of the query's virtual corpus had to be performed.
#'
#' @examples
+#' # Fetch metadata of every query hit for "Ameisenplage" and show a summary
#' kco <- new("KorAPConnection")
#' kqo <- corpusQuery(kco, "Ameisenplage")
#' kqo <- fetchAll(kqo)
#' kqo
#'
+#' # Use the copy of a KorAP-web-frontend URL for an API query of "Ameise" in a virtual corpus
+#' # and show the number of query hits (but don't fetch them).
+#' kco <- new("KorAPConnection")
#' kqo <- corpusQuery(kco,
#' KorAPUrl = "https://korap.ids-mannheim.de/?q=Ameise&cq=pubDate+since+2017&ql=poliqarp")
#' kqo
#'
+#' # Plot the time/frequency curve of "Ameisenplage"
+#' kco <- new("KorAPConnection")
#' q <- corpusQuery(kco, "Ameisenplage")
#' q <- fetchAll(q, verbose=TRUE)
#' tokensPerYear <- function(year) { return(corpusStats(kco, paste("pubDate in", year))@tokens) }
diff --git a/man/corpusQuery-KorAPConnection-method.Rd b/man/corpusQuery-KorAPConnection-method.Rd
index 04abc71..3f0d791 100644
--- a/man/corpusQuery-KorAPConnection-method.Rd
+++ b/man/corpusQuery-KorAPConnection-method.Rd
@@ -38,15 +38,21 @@
Perform a corpus query via a connection to a KorAP-API-server.
}
\examples{
+# Fetch metadata of every query hit for "Ameisenplage" and show a summary
kco <- new("KorAPConnection")
kqo <- corpusQuery(kco, "Ameisenplage")
kqo <- fetchAll(kqo)
kqo
+# Use the copy of a KorAP-web-frontend URL for an API query of "Ameise" in a virtual corpus
+# and show the number of query hits (but don't fetch them).
+kco <- new("KorAPConnection")
kqo <- corpusQuery(kco,
KorAPUrl = "https://korap.ids-mannheim.de/?q=Ameise&cq=pubDate+since+2017&ql=poliqarp")
kqo
+# Plot the time/frequency curve of "Ameisenplage"
+kco <- new("KorAPConnection")
q <- corpusQuery(kco, "Ameisenplage")
q <- fetchAll(q, verbose=TRUE)
tokensPerYear <- function(year) { return(corpusStats(kco, paste("pubDate in", year))@tokens) }