I want to split train and test but with choose() function not with sample() in R.
I have 58 rows and 28 columns on my dataset (a csv file ) and I want to do a 10-fold or 5-fold CV on this dataset.
How am I going to write the code down for this task ?
I`ve tried:
set.seed(1)
smp_size=choose(58,5, name_dataset) # which is totally wrong but ...
# I haven't figured out yet how to take 5 subsets from 58 observations
# each time I do a 5/10 -fold CV
train_ind=sample(seq_len(nrow(name_dataset)),size=smp_size) # I think sample here is wrong too
train=name_dataset[train_ind,]
test=name_dataset[-train_ind,]