Skip to content

Commit

Permalink
Merge pull request #29 from quanteda/v0_95
Browse files Browse the repository at this point in the history
Fix CRAN issues for resubmission
  • Loading branch information
kbenoit authored Aug 27, 2024
2 parents 066c78e + d93923b commit 66fa7c1
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 59 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
pull_request:
branches: [main, master]

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -29,7 +31,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -47,3 +49,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: quanteda.textplots
Title: Plots for the Quantitative Analysis of Textual Data
Version: 0.94.4
Version: 0.95
Authors@R:
c(
person("Kenneth", "Benoit", email = "[email protected]", role = c("cre", "aut", "cph"), comment = c(ORCID = "0000-0002-0797-564X")),
Expand Down Expand Up @@ -44,4 +44,4 @@ Encoding: UTF-8
BugReports: https://github.com/quanteda/quanteda.textplots/issues
Language: en-GB
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
16 changes: 8 additions & 8 deletions R/textplot_network.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Plot a network of feature co-occurrences
#'
#' Plot an [fcm] object as a network, where edges show co-occurrences of
#' features.
#' @param x a [fcm] or [dfm] object
#' Plot an [fcm][quanteda::fcm] object as a network, where edges show
#' co-occurrences of features.
#' @param x a [fcm][quanteda::fcm] or [dfm][quanteda::dfm] object
#' @param min_freq a frequency count threshold or proportion for co-occurrence
#' frequencies of features to be included.
#' @param omit_isolated if `TRUE`, features do not occur more frequent than
Expand All @@ -27,9 +27,9 @@
#' used for `as.igraph`.
#' @details Currently the size of the network is limited to 1000, because of the
#' computationally intensive nature of network formation for larger matrices.
#' When the [fcm] is large, users should select features using
#' [fcm_select], set the threshold using `min_freq`, or implement
#' own plotting function using [`as.network()`][as.network.fcm].
#' When the [fcm][quanteda::fcm] is large, users should select features using
#' [fcm_select()][quanteda::fcm_select], set the threshold using `min_freq`,
#' or implement own plotting function using [`as.network()`][as.network.fcm].
#' @author Kohei Watanabe and Stefan Müller
#' @examples
#' set.seed(100)
Expand Down Expand Up @@ -59,7 +59,7 @@
#' vertex_labelsize = 1.5 * Matrix::rowSums(fcm_30) /
#' min(Matrix::rowSums(fcm_30)))
#' @export
#' @seealso [fcm()]
#' @seealso [fcm][quanteda::fcm()]
#' @import ggplot2
#' @keywords textplot
textplot_network <- function(x, min_freq = 0.5, omit_isolated = TRUE,
Expand Down Expand Up @@ -187,7 +187,7 @@ as.network.fcm <- function(x, min_freq = 0.5, omit_isolated = TRUE, ...) {

#' Convert an fcm to an igraph object
#'
#' Convert an [fcm] object to an \pkg{igraph} graph object.
#' Convert an [fcm][quanteda::fcm] object to an \pkg{igraph} graph object.
#' @keywords internal
#' @export
as.igraph <- function(x, ...) UseMethod("as.igraph")
Expand Down
13 changes: 7 additions & 6 deletions R/textplot_wordcloud.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#' Plot features as a wordcloud
#'
#' Plot a [dfm] or [quanteda.textstats::textstat_keyness] object as a wordcloud,
#' where the feature labels are plotted with their sizes proportional to their
#' numerical values in the dfm. When `comparison = TRUE`, it plots comparison
#' word clouds by document (or by target and reference categories in the case of
#' a keyness object).
#' Plot a [dfm][quanteda::dfm] or [quanteda.textstats::textstat_keyness] object
#' as a wordcloud, where the feature labels are plotted with their sizes
#' proportional to their numerical values in the dfm. When `comparison = TRUE`,
#' it plots comparison word clouds by document (or by target and reference
#' categories in the case of a keyness object).
#' @details
#' The default is to plot the word cloud of all features, summed across
#' documents. To produce word cloud plots for specific document or set of
Expand All @@ -16,7 +16,8 @@
#' create a dfm where the "documents" represent a subset or a grouping of
#' documents by some document variable.
#'
#' @param x a [dfm] or [quanteda.textstats::textstat_keyness] object
#' @param x a [dfm][quanteda::dfm] or [quanteda.textstats::textstat_keyness]
#' object
#' @param min_size size of the smallest word
#' @param max_size size of the largest word
#' @param min_count words with frequency below min_count will not be plotted
Expand Down
14 changes: 7 additions & 7 deletions R/textplot_xray.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#' Plot the dispersion of key word(s)
#'
#' Plots a dispersion or "x-ray" plot of selected word pattern(s) across one or
#' more texts. The format of the plot depends on the number of [kwic] class
#' objects passed: if there is only one document, keywords are plotted one below
#' the other. If there are multiple documents the documents are plotted one
#' below the other, with keywords shown side-by-side. Given that this returns a
#' \pkg{ggplot2} object, you can modify the plot by adding \pkg{ggplot2} layers
#' (see example).
#' @param ... any number of [kwic] class objects
#' more texts. The format of the plot depends on the number of
#' [kwic][quanteda::kwic] class objects passed: if there is only one document,
#' keywords are plotted one below the other. If there are multiple documents the
#' documents are plotted one below the other, with keywords shown side-by-side.
#' Given that this returns a \pkg{ggplot2} object, you can modify the plot by
#' adding \pkg{ggplot2} layers (see example).
#' @param ... any number of [kwic][quanteda::kwic] class objects
#' @param scale whether to scale the token index axis by absolute position of
#' the token in the document or by relative position. Defaults are absolute
#' for single document and relative for multiple documents.
Expand Down
6 changes: 3 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Submission notes

Fixes NOTEs warned about by CRAN on 22-Jan-2024.
Fixes problems from 0.94.4 that led to the package being archived, because the authors were either in the process of moving countries and taking on a new job, on summer holidays, or frantically trying to fix UBSAN problems in the main **quanteda** package.

# Checks

## Test environments

* local macOS 14.2.1, R 4.2.3
* Ubuntu 22.04 LTS, R 4.2.3
* local macOS 14.4.1, R 4.4.1, and via devtools::check_mac_release()
* Ubuntu 22.04 LTS, R 4.4.1
* Windows release via devtools::check_win_release()
* Windows devel via devtools::check_win_devel()

Expand Down
2 changes: 1 addition & 1 deletion man/as.igraph.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions man/textplot_network.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions man/textplot_wordcloud.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions man/textplot_xray.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/wordcloud.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/wordcloud_comparison.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/Makevars

This file was deleted.

4 changes: 0 additions & 4 deletions src/Makevars.win

This file was deleted.

2 changes: 1 addition & 1 deletion src/wordcloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace Rcpp;
bool qatd_cpp_is_overlap(SEXP x1_, SEXP y1_, SEXP w1_, SEXP h1_, SEXP boxe_) {

double x1 = as<double>(x1_);
double y1 =as<double>(y1_);
double y1 = as<double>(y1_);
double sw1 = as<double>(w1_);
double sh1 = as<double>(h1_);
Rcpp::List boxes(boxe_);
Expand Down

0 comments on commit 66fa7c1

Please sign in to comment.