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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -