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!


http://www.inside-r.org/pretty-r/tool



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





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: enlacemineria@gmail.com

    Greetings!

    ReplyDelete