[R] Function help

Duncan Murdoch murdoch.duncan at gmail.com
Mon Oct 26 12:00:24 CET 2015


On 25/10/2015 10:20 PM, alexander.thomas.1 at louisville.edu wrote:
> Hello,
> 
> I'm following an example in the book, analyzing baseball data with R, but it's not working for me. The example is:

We don't know what "the book" is.  If this is the textbook for your
class, you should ask your instructor for help.
> 
> compute.hr <- function(pid){d <- subset(Batting.60, playerID==pid)
> sum(d$HR)}

That works for me.

Duncan Murdoch

> 
> 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.
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list