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
library(stringr) # Load the stringr package
# Load IPL matches dataset
matches <- read.csv("matches.csv")
# Filter matches where player of the match is a batsman and win_by_wickets is maximum
max_wickets_batsman_pom <- matches %>%
filter(player_of_match != "" & str_detect(player_of_match, "wicketkeeper|all-rounder") == FALSE & win_by_wickets == max(win_by_wickets))
# Print the results
cat("Team with maximum wickets won by a batsman Player of the Match:", max_wickets_batsman_pom$winner, "\n")
## Team with maximum wickets won by a batsman Player of the Match: Kolkata Knight Riders Kings XI Punjab Deccan Chargers Delhi Daredevils Royal Challengers Bangalore Rajasthan Royals Mumbai Indians Chennai Super Kings Royal Challengers Bangalore Sunrisers Hyderabad