Learn R Programming

wrapr (version 2.1.0)

add_name_column: Add list name as a column to a list of data.frames.

Description

Add list name as a column to a list of data.frames.

Usage

add_name_column(dlist, destinationColumn)

Value

list of data frames, each of which as the new destinationColumn.

Arguments

dlist

named list of data.frames

destinationColumn

character, name of new column to add

Examples

Run this code

dlist <- list(a = data.frame(x = 1), b = data.frame(x = 2))
add_name_column(dlist, 'name')

Run the code above in your browser using DataLab