library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
# Load IPL matches dataset
matches <- read.csv("matches.csv")
# Find the match with the maximum runs victory
max_runs_victory_match <- matches %>%
filter(win_by_runs == max(win_by_runs))
# Extract the relevant information
venue <- max_runs_victory_match$venue
date <- max_runs_victory_match$date
player_of_match <- max_runs_victory_match$player_of_match
city <- max_runs_victory_match$city
season <- max_runs_victory_match$season
# Print the results
cat("Team that won by maximum runs:", max_runs_victory_match$winner, "\n")
## Team that won by maximum runs: Mumbai Indians
cat("Venue:", venue, "\n")
## Venue: Feroz Shah Kotla
cat("Date:", date, "\n")
## Date: 06-05-2017
cat("Player of the Match:", player_of_match, "\n")
## Player of the Match: LMP Simmons
cat("City:", city, "\n")
## City: Delhi
cat("Season:", season, "\n")
## Season: 2017