Skip to content

Commit

Permalink
Preserve order of riem_measures() positional arguments; Remove defaul…
Browse files Browse the repository at this point in the history
…t values for station, date_start args (thus making them required); Convert elev and latlon to logicals; Update DESCRIPTION and documentation
  • Loading branch information
JElchison committed Dec 17, 2024
1 parent 8737611 commit 1c8a136
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Authors@R: c(
comment = "The research leading to these results has received funding from the European Research Council under the ERC Grant Agreement number 336167– the CHAI Project"),
person("rOpenSci", role = "fnd",
comment = "https://ropensci.org/"),
person("Daryl", "Herzmann", , "[email protected]", role = "ctb")
person("Daryl", "Herzmann", , "[email protected]", role = "ctb"),
person("Jonathan", "Elchison", email = "[email protected]", role = c("aut"),
comment = c(ORCID = "0009-0004-0787-3426"))
)
Description: Allows to get weather data from Automated Surface Observing
System (ASOS) stations (airports) in the whole world thanks to the
Expand Down
22 changes: 12 additions & 10 deletions R/measures.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#'
#'
#' @param station station ID, see riem_stations()
#' @param data The data columns to return. The available options are: all, tmpf, dwpf, relh, drct, sknt, p01i, alti, mslp, vsby, gust, skyc1, skyc2, skyc3, skyc4, skyl1, skyl2, skyl3, skyl4, wxcodes, ice_accretion_1hr, ice_accretion_3hr, ice_accretion_6hr, peak_wind_gust, peak_wind_drct, peak_wind_time, feel, metar, snowdepth # nolint: line_length_linter
#' @param elev If set to 'yes', the elevation (m) of the station will be included in the output. # nolint: line_length_linter
#' @param latlon If set to 'yes', the latitude and longitude of the station will be included in the output. # nolint: line_length_linter
#' @param date_start date of start of the desired data, e.g. "2016-01-01"
#' @param date_end date of end of the desired data, e.g. "2016-04-22"
#' @inheritParams rlang::args_dots_empty
#' @param data The data columns to return. The available options are: all, tmpf, dwpf, relh, drct, sknt, p01i, alti, mslp, vsby, gust, skyc1, skyc2, skyc3, skyc4, skyl1, skyl2, skyl3, skyl4, wxcodes, ice_accretion_1hr, ice_accretion_3hr, ice_accretion_6hr, peak_wind_gust, peak_wind_drct, peak_wind_time, feel, metar, snowdepth # nolint: line_length_linter
#' @param elev If TRUE, the elevation (m) of the station will be included in the output. # nolint: line_length_linter
#' @param latlon If TRUE, the latitude and longitude of the station will be included in the output. # nolint: line_length_linter
#' @param report_type The report type to query. The available options are: 1 (HFMETAR), 3 (Routine), 4 (Specials). # nolint: line_length_linter
#'
#' @return a data.frame (tibble tibble) with measures,
Expand Down Expand Up @@ -67,12 +68,13 @@
#' )
#' }
riem_measures <- function(
station = "VOHY",
data = "all",
elev = "no",
latlon = "yes",
date_start = "2024-01-01",
station,
date_start,
...,
date_end = as.character(Sys.Date()),
data = "all",
elev = FALSE,
latlon = TRUE,
# skip HFMETAR by default
report_type = "3,4") {
date_start <- format_and_check_date(date_start, "date_start")
Expand All @@ -87,8 +89,8 @@ riem_measures <- function(
query = list(
station = station,
data = data,
elev = elev,
latlon = latlon,
elev = ifelse(elev, "yes", "no"),
latlon = ifelse(elev, "yes", "no"),
year1 = lubridate::year(date_start),
month1 = lubridate::month(date_start),
day1 = lubridate::day(date_start),
Expand Down
23 changes: 13 additions & 10 deletions man/riem_measures.Rd

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

0 comments on commit 1c8a136

Please sign in to comment.