#' @title Getting the Latest Standings in the Premier League
#'
#' @description This function gets the latest standings in the Premier League.
#' @param use_saved_data Whether to use a saved data frame. Default is FALSE.
#' @param data_file An rds file containing a data frame that is created by the get_player_data function.
#' @keywords import
#' @export
#' @examples
#' \dontrun{
#' get_latest_EPL_table()
#' }
get_latest_EPL_table <- function(use_saved_data = FALSE, data_file){
if(use_saved_data != TRUE){
xml2::read_html("http://www.theguardian.com/football/premierleague/table") %>%
rvest::html_nodes(".table--striped") %>%
.[[1]] %>%
rvest::html_table()
} else {
readr::read_rds(data_file)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.