bat_avg | R Documentation |
Calculate batting average of batsmen by season
bat_avg(players, years)
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 |
bat_avg
returns a data frame with nrow
equal to the product of the
number of players and years inputted and 5 columns.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.