Skip to content

Commit

Permalink
lint the Roxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed Dec 18, 2024
1 parent 7b66a91 commit 00845a0
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 34 deletions.
5 changes: 4 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ Suggests:
vcr (>= 0.6.0)
VignetteBuilder:
knitr
Config/Needs/documentation: roxylint
Config/roxylint: list(linters = roxylint::tidy)
Config/testthat/edition: 3
Config/testthat/parallel: true
Encoding: UTF-8
Language: en-US
NeedsCompilation: no
Repository: CRAN
Roxygen: list(markdown = TRUE)
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd",
"roxylint::roxylint"))
RoxygenNote: 7.3.2
X-schema.org-applicationCategory: Tools
X-schema.org-isPartOf: https://ropensci.org
Expand Down
1 change: 0 additions & 1 deletion R/.gitignore

This file was deleted.

26 changes: 13 additions & 13 deletions R/get_power.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Get NASA POWER Data From the POWER API
#' Get NASA POWER data from the POWER API
#'
#' @description Get \acronym{POWER} global meteorology and surface solar energy
#' climatology data and return a tidy data frame [tibble::tibble()]
Expand Down Expand Up @@ -43,7 +43,7 @@
#' <https://power.larc.nasa.gov/docs/methodology/meteorology/wind/>.
#' @param wind_surface A user-supplied wind surface for which the corrected
#' wind-speed is to be supplied. See `wind-surface` section for more detail.
#' @param time_standard \acronym{POWER} provides two different time standards:
#' @param time_standard \acronym{POWER} provides two different time standards.
#' * Universal Time Coordinated (\acronym{UTC}): is the standard time measure
#' that used by the world.
#' * Local Solar Time (\acronym{LST}): A 15 degree swath that represents
Expand Down Expand Up @@ -145,7 +145,7 @@
#'
#' @return A data frame as a `POWER.Info` class, an extension of the
#' [tibble::tibble], object of \acronym{POWER} data including location, dates
#' (not including \dQuote{climatology}) and requested parameters. A decorative
#' (not including \dQuote{climatology}) and requested parameters; a decorative
#' header of metadata is included in this object.
#'
#' @references
Expand Down Expand Up @@ -316,15 +316,15 @@ get_power <- function(community = c("ag", "re", "sb"),

# subfunctions internal to get_power() -----------------------------------------

#' Check Dates for Validity When Querying API
#' Check dates for validity when querying the API
#'
#' Validates user entered dates against `lonlat` and `temporal_api` values
#'
#' @param dates User entered `dates` value.
#' @param lonlat User entered `lonlat` value.
#' @param temporal_api User entered `temporal_api` value.
#'
#' @return Validated dates in a list for use in `.build_query`
#' @return Validated dates in a list for use in `.build_query`.
#' @keywords internal
#' @noRd
.check_dates <- function(dates, lonlat, temporal_api) {
Expand Down Expand Up @@ -458,7 +458,7 @@ get_power <- function(community = c("ag", "re", "sb"),
#' <https://power.larc.nasa.gov/docs/methodology/meteorology/wind/>.
#' @param wind_surface A user-supplied wind surface for which the corrected
#' wind-speed is to be supplied. See `wind-surface` section for more detail.
#' @return Nothing, called for its side-effects of checking user inputs
#' @return Nothing, called for its side-effects of checking user inputs.
#' @keywords Internal
#' @noRd

Expand Down Expand Up @@ -573,7 +573,7 @@ get_power <- function(community = c("ag", "re", "sb"),
#' @param lonlat User entered `lonlat` value.
#' @param pars User entered `pars` value.
#'
#' @return A list called `lonlat_identifier` for use in [.build_query()]
#' @return A list called `lonlat_identifier` for use in [.build_query()].
#' @keywords internal
#' @noRd
.check_lonlat <-
Expand Down Expand Up @@ -678,14 +678,14 @@ get_power <- function(community = c("ag", "re", "sb"),
#' Construct a list of options to pass to the POWER API
#'
#' @param community A validated value for community from [check_community()].
#' @param lonlat_identifier A list of values, a result of [check_lonlat()]
#' @param lonlat_identifier A list of values, a result of [check_lonlat()].
#' @param pars A validated value from [check_pars()].
#' @param dates A list of values, a result of [check_dates()].
#' @param site_elevation A validated value from
#' @param wind_elevation A validate value from
#' @param wind_surface A validated value from
#' @param dates A list of values, a result of [check_dates()]..
#' @param site_elevation A validated value passed by `check_inputs`.
#' @param wind_elevation A validated value passed by `check_inputs`.
#' @param wind_surface A validated value passed by `check_inputs`.
#' @return A `list` object of values to be passed to a [crul] object to query
#' the 'POWER' 'API'
#' the 'POWER' 'API'.
#' @keywords internal
#' @noRd
.build_query <- function(community,
Expand Down
16 changes: 8 additions & 8 deletions R/internal_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param table A table containing values to match `x` against.
#'
#' @return A logical vector, indicating if a mismatch was located for any
#' element of x: thus the values are TRUE or FALSE and never NA.
#' element of x: thus the values are `TRUE` or `FALSE` and never `NA`.
#' @keywords internal
#' @noRd
`%notin%` <- function(x, table) {
Expand All @@ -21,7 +21,7 @@
#' @param community User entered `community` value.
#' @param temporal_api User entered `temporal_api` value.
#'
#' @return Validated a collapsed string of `pars` for use in [.build_query()]
#' @return Validated a collapsed string of `pars` for use in [.build_query].
#' @keywords internal
#' @noRd
.check_pars <-
Expand Down Expand Up @@ -75,8 +75,8 @@
#' Boolean
#'
#' Checks if provided object is a Boolean i.e. a length-one logical vector.
#' @param x an object to check
#' @return a logical value indicating whether provided object is a Boolean
#' @param x an object to check.
#' @return a logical value indicating whether provided object is a `Boolean`.
#' @examples
#' is_boolean(TRUE) # [1] TRUE
#' # the following will work on most systems, unless you have tweaked global Rprofile
Expand Down Expand Up @@ -123,13 +123,13 @@
}
}

#' Sends the Query to the POWER Data API to Retrieve Data
#' Sends the query to the POWER data API to retrieve data
#'
#' @param .query_list A query list created by [.build_query()]
#' @param .url A character string of the URL to be used for the \acronym{API}
#' query
#' @keywords internal
#' @return A response from the POWER server containing either an error message
#' @return A response from the POWER server containing either an error message.
#' or the data requested.
#' @noRd
#'
Expand Down Expand Up @@ -159,12 +159,12 @@
}


#' Sends the Query to the POWER Management API
#' Sends the query to the POWER management API
#'
#' There are no parameters that these API end points accept.
#'
#' @param .url A character string of the URL to be used for the \acronym{API}
#' query
#' query.
#' @keywords internal
#' @return A response from the POWER server containing either an error message
#' or the data requested.
Expand Down
6 changes: 3 additions & 3 deletions R/print_POWER_Info.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Prints Power.Info Object
#' Prints Power.Info object
#'
#' @param x POWER.Info object
#' @param ... ignored
#' @param x POWER.Info object.
#' @param ... ignored.
#' @export
#' @noRd
print.POWER.Info <- function(x, ...) {
Expand Down
2 changes: 1 addition & 1 deletion R/query_groupings.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Query the POWER API for Detailed Information on Available Parameter Groupings
#' Query the POWER API for detailed information on available parameter groupings
#'
#' Queries the \acronym{POWER} \acronym{API} returning detailed information on
#' available parameter groupings grouped by community followed by temporal
Expand Down
2 changes: 1 addition & 1 deletion R/query_parameters.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Query the POWER API for Detailed Information on Available Parameters
#' Query the POWER API for detailed information on available parameters
#'
#' Queries the \acronym{POWER} \acronym{API} returning detailed information on
#' available parameters. For a list of all available parameters, use
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"applicationCategory": "Tools",
"isPartOf": "https://ropensci.org",
"keywords": ["NASA", "meteorological-data", "weather", "global", "weather-data", "meteorology", "NASA-POWER", "agroclimatology", "earth-science", "data-access", "climate-data", "r", "nasa-power", "nasa", "agroclimatology-data", "weather-variables", "rstats", "r-package"],
"fileSize": "511.742KB",
"fileSize": "511.981KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
6 changes: 3 additions & 3 deletions man/get_power.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/query_groupings.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/query_parameters.Rd

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

1 change: 1 addition & 0 deletions nasapower.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: b5850c27-668d-4a11-be2e-100f95063eb7

RestoreWorkspace: No
SaveWorkspace: No
Expand Down

0 comments on commit 00845a0

Please sign in to comment.