I have a matrix with 10 rows and 4 columns. I want to use the first 5 rows as a training data set . I want to know if in R we can do that or do I need to turn a matrix into a Vector?
Asked
Active
Viewed 101 times
0
-
Use `training <- m1[1:5,]` or `training <- head(m1, 5)` – akrun Jan 25 '22 at 17:53
-
Or for 3+ sets [R: How to split a data frame into training, validation, and test sets?](https://stackoverflow.com/q/36068963/8366499) – divibisan Jan 25 '22 at 17:57