R/read_start_list.R

Defines functions read_start_list

Documented in read_start_list

#' Scrape Race Start Lists
#'
#' Simple function to grab start lists from FIS website.
#'
#' @import rvest
#' @export
read_start_list <- function(url,type = c('sprint','distance')){
  tbl <- read_html(x = url) %>%
    html_table(fill = TRUE)

  tbl <- tbl[[2]][,1:3] %>%
    rename(fisid = `FIS Code`,
           name = Name,
           bib = Bib) %>%
    select(fisid,name,bib) %>%
    mutate(fisid = as.character(fisid))

  tbl
}
joranE/statskier2 documentation built on May 19, 2019, 8:42 p.m.