I have a data frame with several columns, one of which is a factor called \"site\". How can I split the data frame into blocks of rows each with a unique value of \"site\",
Here's what I would do, although it looks like you guys have it handled by library functions.
for(i in 1:length(unique(data$site))){
constrainedData = data[data$site==data$site[i]];
doSomething(constrainedData);
}
This kind of code is more direct and might be less efficient, but I prefer to be able to read what it is doing than learn some new library function for the same thing. makes this feel more flexible too, but in all honesty this is just the way I figured it out as a novice.