I have a data frame and I'm trying to run a subset on it. In my data frame, I have a column called "start" and I'm trying to do this:
sub <- subset(data,data$start==14)
and I correctly get a subset of all the rows where start=14.
But, when I do this:
for(start in seq(1,20,by=1)) {
sub <- subset(data,data$start==start)
print(sub)
}
it does not correctly find the subsets. It just prints the entire data frame.
Why is this and how do I fix it?