Discriminant analysis splitting data

Hi.
I would like to analyze the data set data(wine) which is available in the R package gclus.
How can I split the data set according to the proportions 70:30 into a training and a test set?

Hi Hope helps

data <- iris
#Partition data into Training and testdata datasets
set.seed(1234)
pd <- sample(2,nrow(data),replace = TRUE, prob = c(0.7,0.3))
traindata <- data[pd==1,]
testdata <- data[pd==2,]

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.