r - caret: Partition cases from multiply imputed datasets -


i ran mice on dataset:

#run mice df <- mice::nhanes imp <- mice(df) #imputes data com <- complete(imp, "long", true) #creates data frame; raw data appended 

now, want create training , testing datasets subsequent analyses. caret can used split data, don't know concise way ensure same cases selected across imputations:

set.seed(1) splitindex <- createdatapartition(y = com$.id, p = 0.8, list = false) #rows considered independent; cases not selected consistently 

any suggestions?

edit:

i have answered own question below.


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -