You split up your dataset into non-overlapping folds, e.g. randomly or stratified. This should be easily doable with R. Then you train your model on one part and test on the rest. In e.g. 10-fold CV you essentially rotate your folds, i.e. 9/10 of the set is used as train- the rest 1/10 as test set. Obviously this could be done 10 times.