Skip to content
Prev 80724 / 398502 Next

split data into training and testing sets

Dhiren DSouza wrote:
See ?sample.

sub <- sample(nrow(x), floor(nrow(x) * 0.9))
training <- x[sub, ]
testing <- x[-sub, ]

HTH,

--sundar