Use \dontrun instead of \donttest for non-essential examples
This is not so nice for the user experience because of the
wrappers arround examples:
## Not run
...
## End(Not run)
but it is necessary to some extent to pass automatic CRAN
checks under all circumstances, which actually do run
the donttest examples since R 4.0 with a time limit of apparently
20min in total.
Change-Id: If09b1aa381e26179ec1a36edd9d8b07116e3c33e
diff --git a/man/KorAPConnection-class.Rd b/man/KorAPConnection-class.Rd
index 33fdb2b..ee18692 100644
--- a/man/KorAPConnection-class.Rd
+++ b/man/KorAPConnection-class.Rd
@@ -92,13 +92,15 @@
New \code{KorAPConnection} objects can be created by \code{new("KorAPConnection")}.
}
\examples{
-\donttest{
+\dontrun{
+
kcon <- new("KorAPConnection", verbose = TRUE)
kq <- corpusQuery(kcon, "Ameisenplage")
kq <- fetchAll(kq)
}
\dontrun{
+
kcon <- new("KorAPConnection", verbose = TRUE, accessToken="e739u6eOzkwADQPdVChxFg")
kq <- corpusQuery(kcon, "Ameisenplage", metadataOnly=FALSE)
kq <- fetchAll(kq)
@@ -106,11 +108,13 @@
}
\dontrun{
+
kco <- new("KorAPConnection", accessToken="e739u6eOzkwADQPdVChxFg")
persistAccessToken(kco)
}
\dontrun{
+
kco <- new("KorAPConnection")
clearAccessToken(kco)
}
diff --git a/man/KorAPQuery-class.Rd b/man/KorAPQuery-class.Rd
index 13f0337..1f0bca3 100644
--- a/man/KorAPQuery-class.Rd
+++ b/man/KorAPQuery-class.Rd
@@ -177,20 +177,25 @@
virtual corpora.
}
\examples{
+\dontrun{
+
# Fetch metadata of every query hit for "Ameisenplage" and show a summary
-\donttest{
new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll()
}
+\dontrun{
+
# 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).
new("KorAPConnection", verbose = TRUE) \%>\%
corpusQuery(KorAPUrl =
"https://korap.ids-mannheim.de/?q=Ameise&cq=pubDate+since+2017&ql=poliqarp")
+}
+
+\dontrun{
# Plot the time/frequency curve of "Ameisenplage"
-\donttest{
new("KorAPConnection", verbose=TRUE) \%>\%
{ . ->> kco } \%>\%
corpusQuery("Ameisenplage") \%>\%
@@ -206,21 +211,26 @@
complete(year = min(year):max(year), fill = list(Freq = 0)) \%>\%
plot(type = "l")
}
-\donttest{q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchNext()
+\dontrun{
+
+q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchNext()
q@collectedMatches
}
-\donttest{
+\dontrun{
+
q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchAll()
q@collectedMatches
}
-\donttest{
+\dontrun{
+
q <- new("KorAPConnection") \%>\% corpusQuery("Ameisenplage") \%>\% fetchRest()
q@collectedMatches
}
-\donttest{
+\dontrun{
+
new("KorAPConnection", verbose = TRUE) \%>\%
frequencyQuery(c("Mücke", "Schnake"), paste0("pubDate in ", 2000:2003))
}
diff --git a/man/association-score-functions.Rd b/man/association-score-functions.Rd
index 3f6b4b7..914d96c 100644
--- a/man/association-score-functions.Rd
+++ b/man/association-score-functions.Rd
@@ -57,7 +57,8 @@
\strong{ll}: log-likelihood (Dunning 1993) using Stefan Evert's (2004) simplified implementation
}
\examples{
-\donttest{
+\dontrun{
+
new("KorAPConnection", verbose = TRUE) \%>\%
collocationScoreQuery("Perlen", c("verziertes", "Säue"),
scoreFunctions = append(defaultAssociationScoreFunctions(),
diff --git a/man/collocationAnalysis-KorAPConnection-method.Rd b/man/collocationAnalysis-KorAPConnection-method.Rd
index 840cd47..8ee0418 100644
--- a/man/collocationAnalysis-KorAPConnection-method.Rd
+++ b/man/collocationAnalysis-KorAPConnection-method.Rd
@@ -81,7 +81,8 @@
user interface.
}
\examples{
-\donttest{
+\dontrun{
+
# Find top collocates of "Packung" inside and outside the sports domain.
new("KorAPConnection", verbose = TRUE) \%>\%
collocationAnalysis("Packung", vc=c("textClass=sport", "textClass!=sport"),
@@ -89,7 +90,8 @@
dplyr::filter(logDice >= 5)
}
-\donttest{
+\dontrun{
+
# Identify the most prominent light verb construction with "in ... setzen".
# Note that, currently, the use of focus function disallows exactFrequencies.
new("KorAPConnection", verbose = TRUE) \%>\%
diff --git a/man/collocationScoreQuery-KorAPConnection-method.Rd b/man/collocationScoreQuery-KorAPConnection-method.Rd
index 4aec265..bc236ee 100644
--- a/man/collocationScoreQuery-KorAPConnection-method.Rd
+++ b/man/collocationScoreQuery-KorAPConnection-method.Rd
@@ -56,18 +56,21 @@
based on \code{\link[=frequencyQuery]{frequencyQuery()}}s for a target word and a collocate.
}
\examples{
-\donttest{
+\dontrun{
+
new("KorAPConnection", verbose = TRUE) \%>\%
collocationScoreQuery("Grund", "triftiger")
}
-\donttest{
+\dontrun{
+
new("KorAPConnection", verbose = TRUE) \%>\%
collocationScoreQuery("Grund", c("guter", "triftiger"),
scoreFunctions = list(localMI = function(O1, O2, O, N, E, window_size) { O * log2(O/E) }) )
}
-\donttest{
+\dontrun{
+
library(highcharter)
library(tidyr)
new("KorAPConnection", verbose = TRUE) \%>\%
diff --git a/man/hc_add_onclick_korap_search.Rd b/man/hc_add_onclick_korap_search.Rd
index 805ff11..0c56f9a 100644
--- a/man/hc_add_onclick_korap_search.Rd
+++ b/man/hc_add_onclick_korap_search.Rd
@@ -18,7 +18,8 @@
a separate tab.
}
\examples{
-\donttest{
+\dontrun{
+
library(highcharter)
library(tidyr)
diff --git a/man/hc_freq_by_year_ci.Rd b/man/hc_freq_by_year_ci.Rd
index dae39e7..df2a1b7 100644
--- a/man/hc_freq_by_year_ci.Rd
+++ b/man/hc_freq_by_year_ci.Rd
@@ -30,30 +30,6 @@
\strong{Warning:} This function may be moved to a new package.
}
-\examples{
-\donttest{year <- c(1990:2018)}\dontshow{year <- c(2013:2013)}
-\donttest{alternatives <- c("macht []{0,3} Sinn", "ergibt []{0,3} Sinn")}\dontshow{alternatives <- c("macht []{0,3} Sinn")}
-new("KorAPConnection", verbose = TRUE) \%>\%
- frequencyQuery(query = alternatives,
- vc = paste("textType = /Zeit.*/ & pubDate in", year),
- as.alternatives = TRUE) \%>\%
- hc_freq_by_year_ci(as.alternatives = TRUE)
-
-\donttest{
-kco <- new("KorAPConnection", verbose = TRUE)
-expand_grid(
- condition = c("textDomain = /Wirtschaft.*/", "textDomain != /Wirtschaft.*/"),
- year = (2005:2011)
-) \%>\%
- cbind(frequencyQuery(
- kco,
- "[tt/l=Heuschrecke]",
- paste0(.$condition, " & pubDate in ", .$year)
- )) \%>\%
- hc_freq_by_year_ci()
-}
-
-}
\seealso{
Other highcharter-helpers:
\code{\link{hc_add_onclick_korap_search}()}
diff --git a/man/misc-functions.Rd b/man/misc-functions.Rd
index aad5c80..f0ae3c2 100644
--- a/man/misc-functions.Rd
+++ b/man/misc-functions.Rd
@@ -71,7 +71,8 @@
und multiplies conf.low and \code{conf.high} with 10^6.
}
\examples{
-\donttest{
+\dontrun{
+
library(ggplot2)
kco <- new("KorAPConnection", verbose=TRUE)
expand_grid(year=2015:2018, alternatives=c("Hate Speech", "Hatespeech")) \%>\%
@@ -81,10 +82,12 @@
ggplot(aes(x=year, y=f, fill=query, color=query, ymin=conf.low, ymax=conf.high)) +
geom_point() + geom_line() + geom_ribbon(alpha=.3)
}
-\donttest{
+\dontrun{
+
new("KorAPConnection") \%>\% frequencyQuery("Test", paste0("pubDate in ", 2000:2002)) \%>\% ipm()
}
-\donttest{
+\dontrun{
+
new("KorAPConnection") \%>\%
frequencyQuery(c("Tollpatsch", "Tolpatsch"),
vc=paste0("pubDate in ", 2000:2002),
@@ -97,7 +100,8 @@
library(ggplot2)
kco <- new("KorAPConnection", verbose=TRUE)
-\donttest{
+\dontrun{
+
expand_grid(condition = c("textDomain = /Wirtschaft.*/", "textDomain != /Wirtschaft.*/"),
year = (2005:2011)) \%>\%
cbind(frequencyQuery(kco, "[tt/l=Heuschrecke]",