Sunday, 8 April 2012

Pretty R

I just stumbled across a tool for syntax highlighting R code on web pages. It also sticks in hyperlinks to the help pages for keywords. This will make blog posting code easier!

totalrecords <- nrow(mydata)
trainfraction = 0.7
trainrecords = as.integer(totalrecords * trainfraction)
allrows <- 1:totalrecords
trainrows <- sample(totalrecords,trainrecords)
testrows  <- allrows[-trainrows]
#then build model, something like...
model <- lm(theFormula, data=mydata[trainrows,])
Created by Pretty R at

1 comment:

  1. Hi I visited your site and this great. I'd love to make an exchange of links to my mining sites. If you agree please contact me at: