Fix some CRAN policy issues
Change-Id: I6862ea1bfbadbaf5d6090b6655c21ecf66650c16
diff --git a/DESCRIPTION b/DESCRIPTION
index 9a8238e..d0982a8 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -56,7 +56,10 @@
knitr,
purrrlyr,
raster,
- tidyverse
+ tidyverse,
+ sf,
+ geojsonsf,
+ viridisLite
Collate:
'logging.R'
'KorAPConnection.R'
diff --git a/R/KorAPQuery.R b/R/KorAPQuery.R
index 92a5348..db44f17 100644
--- a/R/KorAPQuery.R
+++ b/R/KorAPQuery.R
@@ -1147,10 +1147,14 @@
#' fetchAnnotations()
#'
#' # Access linguistic annotations for match i:
-#' pos_tags <- q@collectedMatches$pos # Data frame with left/match/right columns for POS tags
-#' lemmas <- q@collectedMatches$lemma # Data frame with left/match/right columns for lemmas
-#' morphology <- q@collectedMatches$morph # Data frame with left/match/right columns for morphological tags
-#' atokens <- q@collectedMatches$atokens # Data frame with left/match/right columns for annotation token text
+#' pos_tags <- q@collectedMatches$pos
+#' # Data frame with left/match/right columns for POS tags
+#' lemmas <- q@collectedMatches$lemma
+#' # Data frame with left/match/right columns for lemmas
+#' morphology <- q@collectedMatches$morph
+#' # Data frame with left/match/right columns for morphological tags
+#' atokens <- q@collectedMatches$atokens
+#' # Data frame with left/match/right columns for annotation token text
#' raw_snippet <- q@collectedMatches$annotation_snippet[[i]] # Original XML snippet for match i
#'
#' # Access specific components:
@@ -1166,6 +1170,8 @@
#' fetchAnnotations(foundry = "marmot")
#' q@collectedMatches$pos$left[1] # POS tags for the left context of the first match
#' }
+#' @usage fetchAnnotations(kqo, foundry = "tt", overwrite = FALSE,
+#' verbose = kqo@korapConnection@verbose)
#' @export
setMethod("fetchAnnotations", "KorAPQuery", function(kqo, foundry = "tt", overwrite = FALSE, verbose = kqo@korapConnection@verbose) {
if (is.null(kqo@collectedMatches) || nrow(kqo@collectedMatches) == 0) {
diff --git a/demo/corpus_size_by_year.R b/demo/corpus_size_by_year.R
index 853b629..5010d08 100644
--- a/demo/corpus_size_by_year.R
+++ b/demo/corpus_size_by_year.R
@@ -4,7 +4,6 @@
#
library(RKorAPClient)
library(ggplot2)
-library(scales) # For comma_format()
# Define years to analyze
years <- 1990:2024
@@ -26,7 +25,7 @@
g <- ggplot(corpus_data, aes(x = year, y = tokens)) +
geom_col(fill = "steelblue", alpha = 0.7) +
scale_x_continuous(breaks = seq(1990, 2024, 5)) +
- scale_y_continuous(labels = scales::comma_format()) +
+ scale_y_continuous(labels = function(x) format(x, big.mark = ",", scientific = FALSE)) +
labs(
title = "Corpus Size by Year - Stern Magazine",
subtitle = "Number of tokens in DeReKo",
diff --git a/demo/regional.R b/demo/regional.R
index cf31ab7..10b5f82 100755
--- a/demo/regional.R
+++ b/demo/regional.R
@@ -1,7 +1,7 @@
#!/usr/bin/Rscript
library(RKorAPClient)
library(ggplot2)
-library(sf)
+## sf is used via sf::; don't attach package in demo to avoid undeclared library() calls
# library(R.cache)
devAskNewPage(ask = FALSE)
diff --git a/man/fetchAnnotations-KorAPQuery-method.Rd b/man/fetchAnnotations-KorAPQuery-method.Rd
index 36f28f0..ea00bcb 100644
--- a/man/fetchAnnotations-KorAPQuery-method.Rd
+++ b/man/fetchAnnotations-KorAPQuery-method.Rd
@@ -5,7 +5,8 @@
\alias{fetchAnnotations}
\title{Fetch annotations for all collected matches}
\usage{
-\S4method{fetchAnnotations}{KorAPQuery}(kqo, foundry = "tt", overwrite = FALSE, verbose = kqo@korapConnection@verbose)
+\S4method{fetchAnnotations}{KorAPQuery}(kqo, foundry = "tt", overwrite = FALSE,
+ verbose = kqo@korapConnection@verbose)
}
\arguments{
\item{kqo}{object obtained from \code{\link[=corpusQuery]{corpusQuery()}} with collected matches. Note: the original corpus query should have \code{metadataOnly = FALSE} for annotation parsing to work.}
@@ -61,16 +62,24 @@
fetchAnnotations()
# Access linguistic annotations for match i:
-pos_tags <- q@collectedMatches$pos # Data frame with left/match/right columns for POS tags
-lemmas <- q@collectedMatches$lemma # Data frame with left/match/right columns for lemmas
-morphology <- q@collectedMatches$morph # Data frame with left/match/right columns for morphological tags
-atokens <- q@collectedMatches$atokens # Data frame with left/match/right columns for annotation token text
-raw_snippet <- q@collectedMatches$annotation_snippet[[i]] # Original XML snippet for match i
+pos_tags <- q@collectedMatches$pos
+# Data frame with left/match/right columns for POS tags
+lemmas <- q@collectedMatches$lemma
+# Data frame with left/match/right columns for lemmas
+morphology <- q@collectedMatches$morph
+# Data frame with left/match/right columns for morphological tags
+atokens <- q@collectedMatches$atokens
+# Data frame with left/match/right columns for annotation token text
+raw_snippet <- q@collectedMatches$annotation_snippet[[i]]
+# Original XML snippet for match i
# Access specific components:
-match_pos <- q@collectedMatches$pos$match[[i]] # POS tags for the matched tokens in match i
-left_lemmas <- q@collectedMatches$lemma$left[[i]] # Lemmas for the left context in match i
-right_tokens <- q@collectedMatches$atokens$right[[i]] # Token text for the right context in match i
+match_pos <- q@collectedMatches$pos$match[[i]]
+# POS tags for the matched tokens in match i
+left_lemmas <- q@collectedMatches$lemma$left[[i]]
+# Lemmas for the left context in match i
+right_tokens <- q@collectedMatches$atokens$right[[i]]
+# Token text for the right context in match i
# Use a different foundry (e.g., MarMoT)
q <- KorAPConnection() |>