Skip to content

bind_rows and list names #1337

@bramtayl

Description

@bramtayl

It seems like, at the moment, bind_rows, when applied to a list, disregards name information. I've been doing things like this:

test = list(source_1 = data_frame(a = 1), 
            source_2 = data_frame(a = 1) )

1:length(test) %>%
  lapply(function(i)
  test[[i]] %>%
    mutate(name = names(test)[i]) ) %>%
  bind_rows

It seems like a straightforward solution would be to have extra argument which specifies the name of a column to contain list name information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions