add_id_col: Add id column to dataframe

View source: R/list_functions.R

add_id_colR Documentation

Add id column to dataframe

Description

add_id_col() adds an id column to either a data frame or to each data frame in a list.

listindex_to_col() adds the listindex from the first list of a list of data frames as an ID column in each of the nested data frames.

Usage

add_id_col(.data, value = 1L, var = "doc_id")

listindex_to_col(.data, var = "doc_id")

Arguments

.data

A list (or list of lists) of data frames.

value

A value to assign as the id.

var

Character name of the new id column.

See Also

unnest_df


Technomics/costmisc documentation built on Nov. 12, 2024, 8:05 a.m.