[R] Function help

alexander.thomas.1 at louisville.edu alexander.thomas.1 at louisville.edu
Mon Oct 26 03:20:26 CET 2015


Hello,

I'm following an example in the book, analyzing baseball data with R, but it's not working for me. The example is:

compute.hr <- function(pid){d <- subset(Batting.60, playerID==pid)
sum(d$HR)}

Every time I try this, it says there's an unexpected symbol. Any idea on what the unexpected symbol is or how to fix it? Thanks.



More information about the R-help mailing list