I am trying to partition my data set(my.data2) to train and test, but when I run the below script, I got an error show below:
ind<-sample(2,nrow(my.data2),replace = TRUE, prob=c(0.8,0.2))
train <- my.data2[ind=1, ]
test <- my.data2[ind=2,]
I will get the following error:
Error in `[.tbl_df`(my.data2, ind = 1, ) : unused argument (ind = 1)
Appreciate for any help!