1

How can I rbind a list of data frames using only specific columns? Something like do.call(rbind, data) works fine, but I dont't know how to exclude a vector of specific columns. Dropping unnecessary columns afterwards seems is ok, but maybe there is a cleaner way to do this?

Matthias Preu
  • 783
  • 2
  • 8
  • 18

1 Answers1

1

I can simply use subset (thanks to @Jaap):

do.call(rbind, lapply(data, subset, select=c("use_this", "and_this")))
Matthias Preu
  • 783
  • 2
  • 8
  • 18