I have many data.tables in memory with names following a specific pattern (e.g.: RE_1, RE_2... CO_1, CO_2...). I want to bind them efficiently to get only two data.tables (RE an
Try
rbindlist(lapply(ls(pattern = "RE"),get))
Dont know if this is the most effective way but... It works.
ls(...) returns a vector with the names of your data.tables. Not the data.tables themself. get gets you the object by name.
ls(...)
get
You can also use
rbindlist(mget(ls(pattern = "RE")))