I'm attempting to split a data frame into training and test sets using createDataPartition in R, with the training set having 60% of the data. When I ran this code and looked at the resulting objects, SF.training_2 had all of the observations and SF_test.2 had none. Help? I was also getting an error message that the summary command wasn't recognized even though I had run it successfully elsewhere in my code, which I had found confusing/concerning.
inTrain <- createDataPartition(
y = paste(data_train_test$Rooms,
data_train_test$crime_nn5,
data_train_test$nhood,
data_train_test$BLDGSQFT,
data_train_test$estimate),
p = .60,
list = FALSE)
SF.training_2 <- data_train_test[inTrain,]
summmary(SF.training_2)
SF.test_2 <- data_train_test[-inTrain,]