Skip to content

Commit

Permalink
Make package citation optional
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahlowens committed Jun 23, 2024
1 parent b4fd865 commit d6ebda8
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.5.7
Date: 2024-06-23 13:30:32 UTC
SHA: 547f788a4430979117ed5e5aea803b043c9921ba
Date: 2024-06-23 14:07:20 UTC
SHA: b4fd865c3f391ceffb6f62e409cafb50737bfa0b
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Updated date formatting using `format()` instead of `as.character()`
* Updated test files to incorporate rgbif 3.8.0 output changes, make more efficient
* In occResults, renamed "Dataset", "DatasetKey", and "DataService" to "datasetName", "datasetKey", "dataService", respectively.
* Made an option for removing package citations

# occCite 0.5.6

Expand Down
18 changes: 16 additions & 2 deletions R/occCitePrint.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ print.occCiteCitation <- function(x, ...) {
bySpecies <- FALSE
}

if ("skipPackages" %in% names(args)) {
skipPackages <- args$skipPackages
} else {
skipPackages <- FALSE
}

stopifnot(is(x, "occCiteCitation"))

if (!requireNamespace("RefManageR", quietly = TRUE)) {
Expand Down Expand Up @@ -173,7 +179,11 @@ print.occCiteCitation <- function(x, ...) {
packages <- unique(x$occCitationResults[[i]]$occSearch)
if ("GBIF" %in% packages) packCit <- c(packCit, "rgbif")
if ("BIEN" %in% packages) packCit <- c(packCit, "BIEN")
packCit <- packageCitations(packCit)
if(skipPackages){
packCit <- NULL
} else {
packCit <- packageCitations(packCit)
}

# Print results
cat(paste("Species:", names(x$occCitationResults)[[i]], "\n\n"))
Expand Down Expand Up @@ -202,7 +212,11 @@ print.occCiteCitation <- function(x, ...) {
packages <- unique(recordCitations$occSearch)
if ("GBIF" %in% packages) packCit <- c(packCit, "rgbif")
if ("BIEN" %in% packages) packCit <- c(packCit, "BIEN")
packCit <- packageCitations(packCit)
if(skipPackages){
packCit <- NULL
} else {
packCit <- packageCitations(packCit)
}

# Print results
recordCitations <- recordCitations[order(recordCitations$Citation), ]
Expand Down
4 changes: 2 additions & 2 deletions R/studyTaxonList.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#' containing the names of taxa of interest
#'
#' @param datasources A vector of taxonomic data sources implemented in
#' \code{\link{gnr_resolve}}. You can see the list using
#' \code{\link[taxize]{gnr_resolve}}. You can see the list using
#' \code{taxize::gnr_datasources()}.
#'
#' @return An object of class \code{\link{occCiteData}} containing the type
#' of inquiry the user has made --a phylogeny or a vector of names-- and a
#' data frame containing input taxa names, the closest match according to
#' \code{\link{gnr_resolve}}, and a list of taxonomic data sources that
#' \code{\link[taxize]{gnr_resolve}}, and a list of taxonomic data sources that
#' contain the matching name.
#'
#' @examples
Expand Down
1 change: 1 addition & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This is a package update. In this version, I have:
* Updated date formatting using `format()` instead of `as.character()`
* Updated test files to incorporate rgbif 3.8.0 output changes, make more efficient
* In occResults, renamed "Dataset", "DatasetKey", and "DataService" to "datasetName", "datasetKey", "dataService", respectively.
* Made an option for removing package citations.

## Test environments
* local OS X 14.5 install, R 4.3.2 (with and without internet connection)
Expand Down
1 change: 1 addition & 0 deletions docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pkgdown_sha: ~
articles:
a_Simple: a_Simple.html
b_Advanced: b_Advanced.html
last_built: 2024-06-23T14:01Z
last_built: 2024-06-23T14:32Z

4 changes: 2 additions & 2 deletions docs/reference/studyTaxonList.html

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

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

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

0 comments on commit d6ebda8

Please sign in to comment.