Just spoke at The Berkeley R Language Beginner Study Group. Great audience, very bright. Here are my slides: StartR.pdf .
Data Scientist and trainer at Win Vector LLC. One of the authors of Practical Data Science with R.
I tried out your example on slide 9 and was having trouble. Then I realized there was a close-paren missing from the very end. It should be:
CarData <- read.table(url('http://archive.ics.uci.edu/ml/machine-learning-databases/car/car.data'), sep=',',col.names=c('buying','maintenance','doors','persons','lug_boot','safety','rating'))
I hope that helps someone.
On page 10, when I tried this command:
CarData$testTrainGroup <- sample(100,size=dim(CarData)[],replace=T)cTrain 20)cTest <- subset(CarData,testTrainGroup<=20)m <- glm(rating!='unacc' ~ buying + maintenance + doors + persons + lug_boot +safety, family=binomial(link = "logit"),data=cTrain)
…I got this error:
Error: unexpected symbol in "CarData$testTrainGroup <- sample(100,size=dim(CarData)[],replace=T)cTrain"
I'm new to R, and I don't understand what's happening in this command yet, so I'm not sure how to troubleshoot….
Sorry about any typos (pasting into and out of Keynote/PDF is a problem). The second error looks like all of the line breaks are lost. R needs either line-breaks or semicolons to break up commands.