if you don't want createDataPartition to result in a list, but rather a matrix use the list=FALSE parameter