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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -