R/readurl.R

#' @title Read URL
#'
#' @description makes sure the connection is good, if so, returns xml material, otherwise returns NA
#' @keywords HTML, XML
#' @export
#' @examples
#' readUrl()

readUrl <- function(url) {
  out <- tryCatch(
    {
      xml2::read_html(url)
    },
    error=function(e) {NA}
  )
}
emilykuehler/basketballstatsR documentation built on May 31, 2019, 10:01 a.m.