I am trying to make new datasets from an existing dataset. I want to split it by selecting specific rows to go in each dataset. I have managed to slice out the data I want using my.data %<% slice()
. I have tried to create a new data frame using this format:
ed_exp1 <- education[c(10:21),c(2,6:7)]
but I keep getting this error:
Error: Positive column indexes in `[` must match number of columns:
* `.data` has 8 columns.
How do I go about naming this slice/turning it into a dataset that I can do further analysis on?