R/products.R

Defines functions twoep twoal

Documented in twoal twoep

#' @title twoal
#' @description Atlantic Tropical Weather Outlook
#' @details This function parses the latest xml tropical weather outlook for
#' the Atlantic ocean. The core data is located in the `channel$item` element
#' where `title`, `description` and `pubDate` reside. `link` is also
#' available to point to the NHC website.
#' @export
twoal <- function() {
  url <- "http://www.nhc.noaa.gov/index-at.xml"
  contents <- xml2::read_xml(url) %>% xml2::as_list()
  return(contents)
}

#' @title twoep
#' @description East Pacific Tropical Weather Outlook
#' @details This function parses the latest xml tropical weather outlook for
#' the east Pacific. The core data is located in the `channel$item` element
#' where `title`, `description` and `pubDate` reside. `link` is also
#' available to point to the NHC website.
#' @export
twoep <- function() {
  url <- "http://www.nhc.noaa.gov/xml/TWOEP.xml"
  contents <- xml2::read_xml(url) %>% xml2::as_list()
  return(contents)
}
timtrice/Hurricanes documentation built on Oct. 8, 2018, 1:25 a.m.