R/get_id.R

Defines functions get_id

Documented in get_id

#' Get ID's of the datasets on the Mopex website
#'
#' @return list of ID's
#' @export
#'
#' @examples
#' get_id()
get_id <- function(){
  ids <- readLines(con = "https://hydrology.nws.noaa.gov/pub/gcip/mopex/US_Data/Us_438_Daily/")
  ids <- substr(x = ids,
                start = 82,
                stop = 93)
  ids <- ids[grep(pattern = ".dly",
                  x = ids)]
  ids <- gsub(pattern = ".dly",
              replacement = "",
              x = ids)
  head(ids)
}
veravavan/RPackage documentation built on Dec. 23, 2021, 3:03 p.m.