topepo / APM_Exercises

Exercises for the book Applied Predictive Modeling by Kuhn and Johnson (2013)
194 stars 158 forks source link

Minor bug in createGrantData.R code in AppliedPredictiveModeling #3

Open notesofdabbler opened 8 years ago

notesofdabbler commented 8 years ago

Thanks for the great book on Applied Predictive Modeling. I am learning a lot reading and working through it. I am not sure if this is the right place to leave this comment but this seemed related to APM book and so I am listing this here.

I was working through createGrantData.R code to create grantData dataset. It seems like line 375 should be modified:

# line 375
# Original line gives days from 1 to 31 and with this the code 12_Discriminant_Analysis.R doesn't work correctly
grantData$Day <- day(startTime)
# Modified the code to the following to get days of year (as described in text book, p284, fig 12.3) and this seems to give the plots
# shown in the text when 12_Discriminant_Analysis.R is run 
grantData$Day <- yday(startTime)

Also, is the following line part of the code to create the dataset

save(training,testing,pre2008,fullSet,reducedSet,file = "grantData.Rdata")

The version of AppliedPredictiveModeling package that I have is 1.1-6.

Shankar