I have a number of large DFs and I want to loop through them. Instead of binding them together to make a big list I thought I should make a simple vector with their names and look though them, but how can I do this?
For example I have:
DF1 <- data.frame(c("a", "b", "c"),c(TRUE, FALSE, TRUE))
DF2 <- data.frame(c("aa", "bb", "cc"),c(FALSE, FALSE, TRUE))
DF3 <- data.frame(c("aaa", "bbb", "ccc"),c(TRUE, FALSE, FALSE))
MyDFs <- c("DF1", "DF2", "DF3")
for (i in MyDFs) {
print(nrow(i))
}
but the for loop does not work as R does not recognise them as the DFs, how can I correct this? also is this the best way to do this?