Calculcate additional batting statistics
Batting does not contain batting statistics derived from those
present in the data.frame. This function calculates
batting average (
plate appearances (
total bases (
slugging percentage (
on-base percentage (
on-base percentage + slugging (
batting average on balls in play (
for each record in a Batting-like data.frame.
1 2 3
input data, typically
ID variables to include in the output data.frame
Standard calculations, e.g.,
BA <- H/AB are problematic because of the
NAs and zeros. This function tries to deal with those
A data.frame with all the observations in
cbind==FALSE, only the
idvars and the calculated variables are returned.
Michael Friendly, Dennis Murphy
1 2 3 4
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.