hadley/dplyr — pull request #825 by lionelgit (2014-12-03 10:31:03+00:00)
Title: Add .id argument to bind_rows

This makes row_binds append an identifier column when the `.id` argument is supplied.

This is useful for the common use case of combining data frames to be used for example by ggplot2. Best used with lowliner :-)

```
fits <- list(lm(disp ~ cyl, mtcars), lm(disp ~ mpg, mtcars)) %>%
map(broom::tidy) %>%
bind_rows(.id = "model")

## > + Source: local data frame [4 x 6]
##
## term estimate std.error statistic p.value id
## 1 (Intercept) -156.609 35.1805 -4.4516 1.0902e-04 model 1
## 2 cyl 62.599 5.4693 11.4455 1.8028e-12 model 1
## 3 (Intercept) 580.884 41.7401 13.9167 1.2634e-14 model 2
## 4 mpg -17.429 1.9925 -8.7472 9.3803e-10 model 2
```