Skip to content

Commit

Permalink
Roxygen linting
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed Dec 17, 2024
1 parent 7d1087e commit 1ea4ac1
Show file tree
Hide file tree
Showing 13 changed files with 276 additions and 276 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Config/testthat/parallel: true
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd",
"roxyglobals::global_roclet"))
"roxyglobals::global_roclet", "roxylint::roxylint"))
Config/roxylint: list(linters = roxylint::tidy)
RoxygenNote: 7.3.2
X-schema.org-applicationCategory: Tools
X-schema.org-isPartOf: https://ropensci.org
Expand Down
55 changes: 28 additions & 27 deletions R/create_CRU_df.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Create a data.table of Climatology Variables From Local Disk Files
#' Create a data.table of CRU CL 2.0 climatology elements from local disk files
#'
#' Automates importing \acronym{CRU} \acronym{CL} v.2.0 climatology
#' data and creates a \CRANpkg{data.table} of the data. If requested, minimum
Expand All @@ -9,32 +9,33 @@
#'
#' @inheritSection get_CRU_df Nomenclature and Units
#'
#' @param pre Boolean. Load precipitation (millimetres/month) from server and
#' return in the data frame? Defaults to `FALSE`.
#' @param pre_cv Boolean. Load cv of precipitation (percent) from server and
#' return in the data frame? Defaults to `FALSE`. NOTE. Setting this to
#' `TRUE` will always results in **pre** being set to `TRUE` and
#' @param pre Loads precipitation (millimetres/month) from server and
#' returns in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param pre_cv Loads cv of precipitation (percent) from server and
#' returns in the data frame, `TRUE`. Defaults to `FALSE`. NOTE. Setting this
#' to `TRUE` will always results in **pre** being set to `TRUE` and
#' returned as well.
#' @param rd0 Boolean. Load wet-days (number days with >0.1millimetres rain per
#' month) and return in the data frame? Defaults to `FALSE`.
#' @param dtr Boolean. Load mean diurnal temperature range (degrees Celsius)
#' and return it in the data frame? Defaults to `FALSE`.
#' @param tmp Boolean. Load temperature (degrees Celsius) and return it in the
#' data frame? Defaults to `FALSE`.
#' @param tmn Boolean. Calculate minimum temperature values (degrees Celsius)
#' and return it in the data frame? Defaults to `FALSE`.
#' @param tmx Boolean. Calculate maximum temperature (degrees Celsius) and
#' return it in the data frame? Defaults to `FALSE`.
#' @param reh Boolean. Load relative humidity and return it in the data frame?
#' @param rd0 Loads wet-days (number days with >0.1millimetres rain per
#' month) and returns in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param dtr Loads mean diurnal temperature range (degrees Celsius)
#' and returns it in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param tmp Loads temperature (degrees Celsius) and returns it in the
#' data frame, `TRUE`. Defaults to `FALSE`.
#' @param tmn Calculate minimum temperature values (degrees Celsius)
#' and returns it in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param tmx Calculate maximum temperature (degrees Celsius) and
#' return it in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param reh Loads relative humidity and returns it in the data frame, `TRUE`.
#' Defaults to `FALSE`.
#' @param sunp Boolean. Load sunshine, percent of maximum possible (percent of
#' day length) and return it in the data frame? Defaults to `FALSE`.
#' @param frs Boolean. Load ground-frost records (number of days with ground-
#' frost per month) and return it in the data frame? Defaults to `FALSE`.
#' @param wnd Boolean. Load 10m wind speed (metres/second) and return it in the
#' data frame? Defaults to `FALSE`.
#' @param elv Boolean. Load elevation (converted to metres) and return it in
#' the data frame? Defaults to `FALSE`.
#' @param sunp Loads sunshine, percent of maximum possible (percent of
#' day length) and returns it in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param frs Loads ground-frost records (number of days with ground-
#' frost per month) and returns it in the data frame, `TRUE`. Defaults to
#' `FALSE`.
#' @param wnd Load 10m wind speed (metres/second) and returns it in the
#' data frame, `TRUE`. Defaults to `FALSE`.
#' @param elv Loads elevation (converted to metres) and returns it in
#' the data frame, `TRUE`. Defaults to `FALSE`.
#' @param dsn Local file path where \acronym{CRU} \acronym{CL} v.2.0 .dat.gz
#' files are located.
#'
Expand All @@ -52,10 +53,10 @@
#' CRU_tmp
#'
#' @seealso
#' [get_CRU_df()]
#' [get_CRU_df].
#'
#' @return A \CRANpkg{data.table} object of \acronym{CRU} \acronym{CL} v. 2.0
#' climatology elements
#' climatology elements.
#'
#' @author Adam H Sparks, \email{adamhsparks@@gmail.com}
#'
Expand Down
6 changes: 3 additions & 3 deletions R/create_CRU_stack.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Create a List of terra rast Objects From Local Disk Files
#' Create a list of terra rast objects of CRU CL 2.0 climatology elements from local disk files
#'
#' Automates importing \acronym{CRU} \acronym{CL} v.2.0 climatology
#' data and creates a \CRANpkg{terra} [terra::rast] object of the
Expand All @@ -22,10 +22,10 @@
#' CRU_tmp
#'
#' @seealso
#' [get_CRU_stack()]
#' [get_CRU_stack].
#'
#' @return A [base::list] of [terra::rast] objects of \acronym{CRU} \acronym{CL}
#' v. 2.0 climatology elements
#' v. 2.0 climatology elements.
#'
#' @author Adam H. Sparks, \email{adamhsparks@@gmail.com}
#'
Expand Down
59 changes: 29 additions & 30 deletions R/get_CRU_df.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Download and Create a data.table of Climatology Parameters
#' Download and create a data.table of CRU CL 2.0 climatology elements
#'
#' This function automates downloading and importing \acronym{CRU}
#' \acronym{CL} v. 2.0 climatology data and creates a \CRANpkg{data.table} of
Expand All @@ -25,36 +25,36 @@
#' For more information see the description of the data provided by
#' \acronym{CRU}, <https://crudata.uea.ac.uk/cru/data/hrg/tmc/readme.txt>
#'
#' @param pre Boolean. Fetch precipitation (millimetres/month) from server and
#' return in the data frame? Defaults to `FALSE`.
#' @param pre_cv Boolean. Fetch cv of precipitation (percent) from server and
#' return in the data frame? Defaults to `FALSE`. NOTE. Setting this to
#' `TRUE` will always results in **pre** being set to `TRUE` and
#' @param pre Fetches precipitation (millimetres/month) from server and
#' returns it in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param pre_cv Fetch cv of precipitation (percent) from server and
#' returns it in the data frame, `TRUE`. Defaults to `FALSE`. NOTE Setting
#' this to `TRUE` will always results in **pre** being set to `TRUE` and
#' returned as well.
#' @param rd0 Boolean. Fetch wet-days (number days with >0.1 millimetres rain
#' per month) and return in the data frame? Defaults to `FALSE`.
#' @param dtr Boolean. Fetch mean diurnal temperature range (degrees Celsius)
#' and return it in the data frame? Defaults to `FALSE`.
#' @param tmp Boolean. Fetch temperature (degrees Celsius) and return it in the
#' data frame? Defaults to `FALSE`.
#' @param tmn Boolean. Calculate minimum temperature values (degrees Celsius)
#' and return it in the data frame? Defaults to `FALSE`.
#' @param tmx Boolean. Calculate maximum temperature (degrees Celsius) and
#' return it in the data frame? Defaults to `FALSE`.
#' @param reh Boolean. Fetch relative humidity and return it in the data frame?
#' Defaults to FALSE.
#' @param sunp Boolean. Fetch sunshine, percent of maximum possible (percent of
#' @param rd0 Fetches wet-days (number days with >0.1 millimetres rain
#' per month) and returns it in the data frame? Defaults to `FALSE`.
#' @param dtr Fetches mean diurnal temperature range (degrees Celsius)
#' and returns it in the data frame? Defaults to `FALSE`.
#' @param tmp Fetches temperature (degrees Celsius) and returns it in the
#' data frame, `TRUE`. Defaults to `FALSE`.
#' @param tmn Calculates minimum temperature values (degrees Celsius)
#' and returns it in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param tmx Calculates maximum temperature (degrees Celsius) and
#' returns it in the data frame, `TRUE`. Defaults to `FALSE`.
#' @param reh Fetches relative humidity and returns it in the data frame,
#' `TRUE`. Defaults to FALSE.
#' @param sunp Fetch sunshine, percent of maximum possible (percent of
#' day length) and return it in the data frame? Defaults to `FALSE`.
#' @param frs Boolean. Fetch ground-frost records (number of days with ground-
#' @param frs Fetches ground-frost records (number of days with ground-
#' frost per month) and return it in the data frame? Defaults to `FALSE`.
#' @param wnd Boolean. Fetch 10m wind speed (metres/second) and return it in the
#' data frame? Defaults to `FALSE`.
#' @param elv Boolean. Fetch elevation (converted to metres) and return it in
#' the data frame? Defaults to `FALSE`.
#' @param cache Boolean. Store CRU CL v. 2.0 data files locally for later use?
#' If `FALSE`, the downloaded files are removed when R session is closed.
#' @param wnd Fetches 10m wind speed (metres/second) and returns it in the
#' data frame, `TRUE`. Defaults to `FALSE`.
#' @param elv Fetches elevation (converted to metres) and returns it in
#' the data frame, `TRUE`. Defaults to `FALSE`.
#' @param cache Stores CRU CL v. 2.0 data files locally for later use.
#' If `FALSE`, the downloaded files are removed when the \R session is closed.
#' To take advantage of cached files in future sessions, use `cache = TRUE`
#' after the initial download and caching. Defaults to `FALSE`.
#' even after the initial download and caching. Defaults to `FALSE`.
#'
#' @examplesIf interactive()
#' # Download data and create a data frame of precipitation and temperature
Expand All @@ -65,11 +65,10 @@
#' CRU_pre_tmp
#'
#' @seealso
#' [create_CRU_stack()]
#' [manage_cache()]
#' [create_CRU_stack], [manage_cache].
#'
#' @return A \CRANpkg{data.table} object of \acronym{CRU} \acronym{CL} v. 2.0
#' climatology elements
#' climatology elements.
#'
#' @author Adam H. Sparks, \email{adamhsparks@@gmail.com}
#'
Expand Down
12 changes: 5 additions & 7 deletions R/get_CRU_stack.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Download and Create a List of terra rast Objects of Climatology Parameters
#' Download and create a list of terra rast objects of CRU CL 2.0 climatology elements
#'
#' This function automates downloading and importing CRU CL v. 2.0
#' climatology data into \R and creates a list of \CRANpkg{terra}
#' [terra::rast()] objects of the data. If requested, minimum and maximum
#' [terra::rast] objects of the data. If requested, minimum and maximum
#' temperature may also be automatically calculated as described in the data
#' readme.txt file. Data may be cached for later use by this function, saving
#' time downloading files in future using this function.
Expand All @@ -17,13 +17,11 @@
#'
#' CRU_pre_tmp
#'
#'
#' @seealso
#' [create_CRU_stack()]
#' [manage_cache()]
#' [create_CRU_stack], [manage_cache].
#'
#' @return A [base::list()] of [terra::rast] objects of CRU CL v. 2.0
#' climatology elements
#' @return A [base::list] of [terra::rast] objects of CRU CL v. 2.0
#' climatology elements.
#'
#' @author Adam H. Sparks, \email{adamhsparks@@gmail.com}
#'
Expand Down
Loading

0 comments on commit 1ea4ac1

Please sign in to comment.