TrainandTest<-function(data,group,p=0.25){
library(caret)
data<-as.data.frame(data)
inTrain<-createDataPartition(y=group,p=p,list=F)
test<-data[inTrain,]
train<-data[-inTrain,]
dataset<-list('train'=train,'test'=test)
return(dataset)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.