On Monday 13 August 2007 04:25, Li Xiao wrote: > Hi ALL, > > How to randomly divide my sample (a data.frame) into ten separate equal > sets for cross validation? > > Thanks > LiXiao sz <- 10 df <- data.frame(label=1:100,score=rnorm(100)) dfrand <- df[sample(1:nrow(df)),] dfsplit <- split(dfrand,rep(1:sz,nrow(df)/sz)) best wishes ido