## Let's calculate Mike Trout's fielding percentage for 2014
## He had PO = 383, A = 4, E = 3
## We should get an output of .992
fp(383,4,3)
## The function is currently defined as
function (po, a, e)
{
fp <- (po + a)/(po + a + e)
return(fp)
}
Run the code above in your browser using DataLab