Description Usage Arguments Details Value Examples
View source: R/scrape_commentary.R
Scrapes ESPN match commentary for a given game ID
1 | scrape_commentary(game_id)
|
game_id |
ESPN game ID to scrape the match commentary for. |
Through string parsing of the commentary the following columns are created:
"game_id" - Unique identifier for the game from ESPN
"commentary" - Raw text commentary
"match_time" - Match time provided by ESPN in character format
"team_one" - Name of first team in game based on order on game page
"team_two" - Name of second team in game based on order on game page
"team_one_score" - Score for team one
"team_two_score" - Score for team two
"half_begins" - Indicator for when a half begins
"half_end" - Indicator for when a half ends
"match_end" - Indicator for when the match ends
"shot_attempt" - Indicator for if a shot was attempted
"penalty_shot" - Indicator for if a the shot attempt was a penalty shot which includes penalty shootout
"shot_result" - Outcome for shot attempt, either: goal, blocked, missed, saved, or own_goal
"shot_with" - Which foot (left or right) or header person shot with
"shot_where" - Location from field relative to box shot took place from
"shot_by_player" - Player who attempted shot
"shot_by_team" - Team that attempted shot
"assist_by_player" - Player who assisted shot attempt
"assist_type" - Denotes if assist was with a through or cross
"foul" - Indicator if there was a foul
"foul_by_player" - Which player committed the foul
"foul_by_team" - Which team committed the foul
"net_location" - Location relative to net of shot attempt
"follow_set_piece" - Indicator if followed set piece situation
"follow_corner" - Indicator if followed corner kick
"offside" - Indicator if offside was called
"offside_team" - Which team was offside
"offside_player" - Which player was offside
"offside_pass_from" - Which player passed the ball leading to offside
"shown_card" - Indicator if a card was shown
"card_type" - Type of card: red or yellow
"card_player" - Player given the card
"card_team" - Team given the card
"video_review" - Indicator if a video review took place
"video_review_event" - Which event was reviewed
"video_review_result" - Result of the video review
"delay_in_match" - Indicator for if a delay in match was called
"delay_team" - Which team caused the delay
"free_kick_won" - Indicator for if a free kick was won
"free_kick_player" - Which player won the free kick
"free_kick_team" - Which team won the free kick
"free_kick_where" - Where was the free kick won
"corner" - Indicator if a corner kick was awarded
"corner_team" - Which team was awarded the corner kick
"corner_conceded_by" - Which player conceded the corner kick
"substitution" - Indicator for if a substitution took place
"sub_injury" - Indicator for if substitution took place because of injury
"sub_team" - Which team had the substitution
"sub_player" - Which player came in during the substitution
"replaced_player" - Which player was replaced during the substitution
"penalty" - Indicator if penalty occurred
"team_drew_penalty" - Which team was awarded the penalty
"team_conceded_penalty" - Which team conceded the penalty
"player_drew_penalty" - Which player drew the penalty
"player_conceded_penalty" - Which player conceded the penalty
"half" - Numeric indicator for the half: 1 = first, 2 = second, 3 = first extra, 4 = second extra, 5 = penalty shootout
"comment_id" - Row id for comment
"match_time_numeric" - Numeric value for match time minutes
"stoppage_time" - Indicator for if in stoppage time
"team_one_penalty_score" - Tally of team one score in penalty shootout
"team_two_penalty_score" - Tally of team two score in penalty shootout
Data frame of the match commentary with a row for each event in the commentary along with the columns described above.
1 2 | # Get the match commentary for Serbia vs Costa Rica in the 2018 World Cup:
srb_crc_commentary <- scrape_commentary(498194)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.