## Let's calculate Clayton Kershaw's ERA for the 2014 Season
## He had 39 ER's and 198.333 IP
## We should get an ERA = to 1.77
era(39,198.333)
## The function is currently defined as
function (er, ip)
{
era <- (9 * er)/ip
return(era)
}
Run the code above in your browser using DataLab