bat_avg: Calculate batting average of batsmen by season

View source: R/bat_avg.R

bat_avgR Documentation

Calculate batting average of batsmen by season

Description

Calculate batting average of batsmen by season

Usage

bat_avg(players, years)

Arguments

players

a list of batsmen for whom batting average has to be calculated, as character vectors

years

a list of seasons (years) for which the batting average of the given batsmen has to be calculated, as numeric vectors

Value

bat_avg returns a data frame with nrow equal to the product of the number of players and years inputted and 5 columns.

Examples


library(ipl)

# Compute batting average of Virat Kohli in 2019
bat_avg("V Kohli", 2019)


# Compute batting averages of Virat Kohli, MS Dhoni, Rohit Sharma in
# 2017, 2018, and 2019
bat_avg(c("V Kohli", "MS Dhoni", "RG Sharma"), c(2017, 2018, 2019))

Swaha294/ipl documentation built on May 10, 2022, 3:23 p.m.