Skip to content

Commit

Permalink
Fix Rd links and resubmit as 0.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Benoit authored and Kenneth Benoit committed Aug 27, 2024
1 parent 7264fb8 commit 0c02ed0
Show file tree
Hide file tree
Showing 21 changed files with 51 additions and 67 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: quanteda.textmodels
Type: Package
Title: Scaling Models and Classifiers for Textual Data
Version: 0.9.7
Version: 0.9.8
Description: Scaling models and classifiers for sparse matrix objects representing
textual data in the form of a document-feature matrix. Includes original
implementations of 'Laver', 'Benoit', and Garry's (2003) <doi:10.1017/S0003055403000698>,
Expand Down Expand Up @@ -51,7 +51,7 @@ License: GPL-3
Encoding: UTF-8
LazyData: true
Language: en-GB
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
Collate:
'RcppExports.R'
Expand Down
6 changes: 3 additions & 3 deletions R/textmodel_affinity.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#'
#' `textmodel_affinity()` implements the maximum likelihood supervised text
#' scaling method described in Perry and Benoit (2017).
#' @param x the [dfm] or [bootstrap_dfm] object on which the model
#' will be fit. Does not need to contain only the training documents, since
#' the index of these will be matched automatically.
#' @param x the [dfm][quanteda::dfm] or [bootstrap_dfm][quanteda::bootstrap_dfm]
#' object on which the model will be fit. Does not need to contain only the
#' training documents, since the index of these will be matched automatically.
#' @param y vector of training classes/scores associated with each document
#' identified in `data`
#' @param exclude a set of words to exclude from the model
Expand Down
7 changes: 4 additions & 3 deletions R/textmodel_ca.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#' Correspondence analysis of a document-feature matrix
#'
#' `textmodel_ca` implements correspondence analysis scaling on a
#' [dfm]. The method is a fast/sparse version of function [ca][ca::ca].
#' [dfm][quanteda::dfm]. The method is a fast/sparse version of function
#' [ca][ca::ca].
#' @param x the dfm on which the model will be fit
#' @param smooth a smoothing parameter for word counts; defaults to zero.
#' @param nd Number of dimensions to be included in output; if `NA` (the
#' default) then the maximum possible dimensions are included.
#' @param sparse retains the sparsity if set to `TRUE`; set it to
#' `TRUE` if `x` (the [dfm]) is too big to be allocated after
#' `TRUE` if `x` (the [dfm][quanteda::dfm]) is too big to be allocated after
#' converting to dense
#' @param residual_floor specifies the threshold for the residual matrix for
#' calculating the truncated svd.Larger value will reduce memory and time cost
Expand All @@ -22,7 +23,7 @@
#' @note You may need to set `sparse = TRUE`) and
#' increase the value of `residual_floor` to ignore less important
#' information and hence to reduce the memory cost when you have a very big
#' [dfm].
#' [dfm][quanteda::dfm].
#' If your attempt to fit the model fails due to the matrix being too large,
#' this is probably because of the memory demands of computing the \eqn{V
#' \times V} residual matrix. To avoid this, consider increasing the value of
Expand Down
7 changes: 4 additions & 3 deletions R/textmodel_lr.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#' elasticnet penalty at a grid of values for the regularization parameter
#' lambda. This is done automatically by testing on several folds of the data
#' at estimation time.
#' @param x the \link{dfm} on which the model will be fit. Does not need to
#' contain only the training documents.
#' @param x the [dfm][quanteda::dfm] on which the model will be fit. Does not
#' need to contain only the training documents.
#' @param y vector of training labels associated with each document identified
#' in \code{train}. (These will be converted to factors if not already
#' factors.)
#' @param ... additional arguments passed to [`cv.glmnet()`][glmnet::cv.glmnet()]
#' @param ... additional arguments passed to
#' [`cv.glmnet()`][glmnet::cv.glmnet()]
#' @returns an object of class `textmodel_lr`, a list containing:
#' * `x`, `y` the input model matrix and input training class labels
#' * `algorithm` character; the type and family of logistic regression model used in calling
Expand Down
6 changes: 3 additions & 3 deletions R/textmodel_lsa.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Latent Semantic Analysis
#'
#' Fit the Latent Semantic Analysis scaling model to a [dfm], which may be
#' weighted (for instance using [quanteda::dfm_tfidf()]).
#' @param x the [dfm] on which the model will be fit
#' Fit the Latent Semantic Analysis scaling model to a [dfm][quanteda::dfm],
#' which may be weighted (for instance using [quanteda::dfm_tfidf()]).
#' @param x the [dfm][quanteda::dfm] on which the model will be fit
#' @param nd the number of dimensions to be included in output
#' @param margin margin to be smoothed by the SVD
#' @returns a `textmodel_lsa` class object, a list containing:
Expand Down
4 changes: 2 additions & 2 deletions R/textmodel_nb.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#'
#' Fit a multinomial or Bernoulli Naive Bayes model, given a dfm and some
#' training labels.
#' @param x the [dfm] on which the model will be fit. Does not need to
#' contain only the training documents.
#' @param x the [dfm][quanteda::dfm] on which the model will be fit. Does not
#' need to contain only the training documents.
#' @param y vector of training labels associated with each document identified
#' in `train`. (These will be converted to factors if not already
#' factors.)
Expand Down
6 changes: 3 additions & 3 deletions R/textmodel_svm.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#'
#' Fit a fast linear SVM classifier for texts, using the
#' \pkg{LiblineaR} package.
#' @param x the [dfm] on which the model will be fit. Does not need to
#' contain only the training documents.
#' @param x the [dfm][quanteda::dfm] on which the model will be fit. Does not
#' need to contain only the training documents.
#' @param y vector of training labels associated with each document identified
#' in `train`. (These will be converted to factors if not already
#' factors.)
Expand Down Expand Up @@ -213,7 +213,7 @@ print.predict.textmodel_svm <- function(x, ...) {
#' convert a dfm into a matrix.csr from SparseM package
#'
#' Utility to convert a dfm into a [matrix.csr][SparseM::matrix.csr] from the \pkg{SparseM} package.
#' @param x input [dfm]
#' @param x input [dfm][quanteda::dfm]
#' @param ... unused
#' @importFrom SparseM as.matrix.csr
#' @importFrom methods new
Expand Down
4 changes: 2 additions & 2 deletions R/textmodel_svmlin.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#' way that translates into more standard SVM parameters that we understand. Use
#' with caution after reading the Sindhwani and Keerthi (2006) paper.
#'
#' @param x the [dfm] on which the model will be fit. Does not need to contain
#' only the training documents.
#' @param x the [dfm][quanteda::dfm] on which the model will be fit. Does not
#' need to contain only the training documents.
#' @param y vector of training labels associated with each document identified
#' in `train`. (These will be converted to factors if not already factors.)
#' @param intercept logical; if `TRUE`, add an intercept to the data
Expand Down
2 changes: 1 addition & 1 deletion R/textmodel_wordscores.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' unknown texts are obtained using the `predict()` method to score
#' documents from a fitted `textmodel_wordscores` object.
#'
#' @param x the [dfm] on which the model will be trained
#' @param x the [dfm][quanteda::dfm] on which the model will be trained
#' @param y vector of training scores associated with each document
#' in `x`
#' @param smooth a smoothing parameter for word counts; defaults to zero to
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ catm <- quanteda:::catm
#'
#' Takes a dfm and a set of features, and makes them match the features listed
#' in the set.
#' @param x input [dfm]
#' @param x input [dfm][quanteda::dfm]
#' @param features character; a vector of feature names
#' @param force logical; if `TRUE`, make the new dfm conform to the vector of
#' features, otherwise return an error message
Expand Down
26 changes: 3 additions & 23 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
## Purpose

To fix the compilation errors caused by changes to the TBB library and RcppParallel. This version links to quanteda v4.0 that does not rely on RcppParallel.

Also fixes some minor method class and methods signature issues caught by the improved CRAN checks in the forthcoming R v4.
To rescue quanteda.textmodels from CRAN archives, after fixing the issues with
it that led to its archiving on 25 August 2024.

# Checks

## Test environments

* local macOS 14.2.1, R 4.3.3
* local macOS 14.4.1, R 4.4.1
* Windows release via devtools::check_win_release()
* Windows devel via devtools::check_win_devel()
* Windows oldrelease via devtools::check_win_oldrelease()
Expand All @@ -23,25 +22,6 @@ No ERRORs, NOTEs, or WARNINGs produced, except:
data 3.8Mb
libs 3.0Mb

On devtools::check_win_oldrelease(), we saw this false positive:

* using log directory 'd:/RCompile/CRANguest/R-oldrelease/quanteda.textmodels.Rcheck'
* using R version 4.2.3 (2023-03-15 ucrt)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: UTF-8
* checking for file 'quanteda.textmodels/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'quanteda.textmodels' version '0.9.7'
* package encoding: UTF-8
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Kenneth Benoit <kbenoit@lse.ac.uk>'

Found the following (possibly) invalid DOIs:
DOI: 10.1111/j.1540-5907.2008.00338.x
From: DESCRIPTION
Status: Forbidden
Message: 403

## Reverse dependency and other package conflicts

None, according to revdepcheck::revdep_check().
2 changes: 1 addition & 1 deletion man/as.matrix.csr.dfm.Rd

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

2 changes: 1 addition & 1 deletion man/force_conformance.Rd

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

6 changes: 3 additions & 3 deletions man/textmodel_affinity.Rd

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

7 changes: 4 additions & 3 deletions man/textmodel_ca.Rd

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

7 changes: 4 additions & 3 deletions man/textmodel_lr.Rd

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

6 changes: 3 additions & 3 deletions man/textmodel_lsa.Rd

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

4 changes: 2 additions & 2 deletions man/textmodel_nb.Rd

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

4 changes: 2 additions & 2 deletions man/textmodel_svm.Rd

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

4 changes: 2 additions & 2 deletions man/textmodel_svmlin.Rd

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

2 changes: 1 addition & 1 deletion man/textmodel_wordscores.Rd

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

0 comments on commit 0c02ed0

Please sign in to comment.