diff --git a/R/pkrt-list.R b/R/pkrt-list.R index c1536c8..edc020e 100644 --- a/R/pkrt-list.R +++ b/R/pkrt-list.R @@ -10,7 +10,7 @@ #' This function automatically discards duplicate and base packages. You can use #' `pkrt_list()` in combination with `renv::dependencies()` to cite all the #' packages used in a project or directory. -#' @return A list of package citations. +#' @returns A list of package citations with S3 class `pkrt_list`. #' @examples #' # Create a list of citations #' citations <- pkrt_list("pakret", "readr", "withr") @@ -29,11 +29,17 @@ pkrt_list <- function(...) { } drop_base <- function(x) { - x[!x %in% get_base_pkgs()] + x[!x %in% base_pkgs()] } -get_base_pkgs <- function() { - rownames(utils::installed.packages(.Library, priority = "base")) +base_pkgs <- function() { + if (getRversion() >= "4.4.0") { + return(asNamespace("tools")$standard_package_names()[["base"]]) + } + c( + "base", "compiler", "datasets", "graphics", "grDevices", "grid", "methods", + "parallel", "splines", "stats", "stats4", "tcltk", "tools", "utils" + ) } itemize_citations <- function(pkgs) { diff --git a/R/pkrt-set.R b/R/pkrt-set.R index fd405d9..19b0ca8 100644 --- a/R/pkrt-set.R +++ b/R/pkrt-set.R @@ -13,6 +13,7 @@ #' to alter pakret's behavior for a few specific citations only. #' #' Use `NULL` to reset a parameter to its default value. +#' @returns This function is called for its side-effect. It returns no value. #' @examples #' pkrt_set(pkg = ":pkg (v. :ver) :ref") #' pkrt("pakret") diff --git a/cran-comments.md b/cran-comments.md index 858617d..6371687 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,10 @@ +This is a resubmission. + +* I added a `value` section to `pkrt_set()`. +* I specified the class of the output in `pkrt_list()`. +* I removed `utils::installed.packages()` usage and replaced it with a more effecient alternative. +* There's no particular references for the methods used in my package to add to the package description. + ## R CMD check results 0 errors | 0 warnings | 1 note diff --git a/man/pkrt_list.Rd b/man/pkrt_list.Rd index 6976c8f..2210e24 100644 --- a/man/pkrt_list.Rd +++ b/man/pkrt_list.Rd @@ -10,7 +10,7 @@ pkrt_list(...) \item{...}{Character vectors, separated by commas, of packages to cite.} } \value{ -A list of package citations. +A list of package citations with S3 class \code{pkrt_list}. } \description{ Creates a list of package citations that can be turned into a diff --git a/man/pkrt_set.Rd b/man/pkrt_set.Rd index 7da0838..c07af4f 100644 --- a/man/pkrt_set.Rd +++ b/man/pkrt_set.Rd @@ -10,6 +10,9 @@ pkrt_set(...) \item{...}{Key-value pairs, separated by commas, of parameters to set. See details.} } +\value{ +This function is called for its side-effect. It returns no value. +} \description{ This function allows you to configure pakret's settings, e.g. to customize citation templates or control which \code{.bib} file to save