split data in R
train_data has rows of 891
test_data has rows of 418
i would like to split data 70% for train_data and 30% for test_data to get glm model
This is how I am doing
split_testD <- sample(2, nrow(test_data), replace = TRUE, prob = c(0.7,0.3))
split_trainD <- sample(2, nrow(train_data), replace = TRUE, prob = c(0.7,0.3))
But for some reason when i try to get glm model it gets me less rows for test_data which is not right