Skip to content

Commit

Permalink
style: rename available_versions() in get_available_versions()
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Feb 13, 2024
1 parent a893237 commit 5572907
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by roxygen2: do not edit by hand

export(available_versions)
export(compute_abundances)
export(compute_concentration_bins_CPR_n)
export(compute_concentrations)
Expand All @@ -14,6 +13,7 @@ export(filter_by_polygon)
export(filter_by_species)
export(filter_by_year)
export(geom_basemap)
export(get_available_versions)
export(get_current_version)
export(get_ocean_names)
export(get_required_columns)
Expand Down
4 changes: 2 additions & 2 deletions R/available_versions.R → R/get_available_versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#' @examples
#' ## Versions of the FORCIS database ----
#'
#' available_versions()
#' get_available_versions()

available_versions <- function(record_id = zen_record_id()) {
get_available_versions <- function(record_id = zen_record_id()) {

## Check argument ----

Expand Down
6 changes: 3 additions & 3 deletions R/get_version_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#' in the Zenodo database.
#'
#' @param version a `character` of length 1. The label of the version. Use
#' [available_versions()] to list available versions. If `NULL` (default) the
#' latest version is used.
#' [get_available_versions()] to list available versions. If `NULL` (default)
#' the latest version is used.
#'
#' @return A `list` with all information about the version, including: `title`,
#' `doi`, `publication_date`, `description`, `access_right`, `creators`,
Expand Down Expand Up @@ -56,7 +56,7 @@ get_version_info <- function(record_id = zen_record_id(), version = NULL) {
if (length(pos) == 0) {

stop("The required version is not available. Please run ",
"'available_versions()' to list available versions.")
"'get_available_versions()' to list available versions.")
}
}

Expand Down
7 changes: 4 additions & 3 deletions R/internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ set_zen_version <- function(version, ask = TRUE) {

check_zen_version(version)

versions <- available_versions()
versions <- get_available_versions()
latest_version <- get_zen_latest_version()

if (is.null(version)) {
Expand All @@ -753,7 +753,8 @@ set_zen_version <- function(version, ask = TRUE) {
if (!(version %in% versions$"version")) {

stop("The required version is not available. Please run ",
"'available_versions()' to list available versions.", call. = FALSE)
"'get_available_versions()' to list available versions.",
call. = FALSE)
}
}

Expand Down Expand Up @@ -792,7 +793,7 @@ set_zen_version <- function(version, ask = TRUE) {

get_zen_latest_version <- function() {

versions <- available_versions()
versions <- get_available_versions()

versions[which.max(as.Date(versions$"publication_date")), "version"]
}
Expand Down
10 changes: 5 additions & 5 deletions man/available_versions.Rd → man/get_available_versions.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/get_version_info.Rd

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

0 comments on commit 5572907

Please sign in to comment.