R/mnet_root_url.R

Defines functions mnet_root_url

Documented in mnet_root_url

#' Root url for Oklahoma Mesonet Time Series files
#'
#' @export
#'
#' @param data_source the data source for which to provide the url: "mesonet"
#'  for the Oklahoma Mesonet, "fcars" for the USDA ARS station network in the
#'  Fort Cobb watershed, or "ars" for the USDA ARS station network in the
#'  Little Washita watershed
#'
#' @return a character string with the root URL for the desired Mesonet data
#'  source
#'
#' @examples
#'
#' mnet_root_url()
#'
#' mnet_root_url("fcars")
#'
mnet_root_url <- function(data_source = "mesonet"){

  stopifnot(data_source %in% c("mesonet", "fcars", "ars"))

  "https://data.mesonet.org/data/public" |>
    paste0("/", data_source)
}

Try the mesonet package in your browser

Any scripts or data that you put into this service are public.

mesonet documentation built on Aug. 9, 2025, 9:07 a.m.