LDBerriz,
I believe it is possible to do what you are trying to do by looping through variable names and getting them from .GlobalEnv, which represents the workspace.
However, I suggest, as several other commenters have, it's far easier to store your tables in a list, and loop over the list, than it is to loop over variables in .GlobalEnv:
tbl.1 <- data.table("A" = runif(5), "B" = runif(5))
tbl.2 <- data.table("A" = runif(5), "B" = runif(5))
tbl.3 <- data.table("A" = runif(5), "B" = runif(5))
tblList <- list(tbl.1, tbl.2, tbl.3)
for (i in 1:3) {
tbl <- tblList[[i]]
# Do something with tbl.
}
For the sake of this answer, I assume that the tables are actually different, or there is some reason you have, that they needs to be separate tables. Of course if the columns of the tables were all the same sort of data/variables, as tbl.1, tbl.2, and tbl.3 in your example are, then you could just combine them into one table and do stuff to the one table:
masterTbl <- rbind(tbl.1,tbl.2,tbl.3)
You could even add a column to them so you can identify which table they originally came from, should you need to:
tbl.1$from <- 1
tbl.2$from <- 2
tbl.3$from <- 3
masterTbl <- rbind(tbl.1,tbl.2,tbl.3)
Best,
Ben.