namedList2longDF: Convert named list to long data.frame

View source: R/utility_functions.R

namedList2longDFR Documentation

Convert named list to long data.frame

Description

Convert named list to long data.frame. Resulting dataframe will have two columns, the first corresponding to the names within the list, and the second to the corersponding list entries.

Usage

namedList2longDF(my.list, name.header = NULL, value.header = NULL)

Arguments

my.list

named list

name.header

character specifying header name that will be assigned to name column. If unspecified, defaults to "name".

value.header

character specifying header name that will be assigned to value column. If unspecified, defaults to "value".

Value

long data.frame

Author(s)

Nicholas Mikolajewicz

See Also

namedList2wideDF

Examples


# specify named list
my.list <- list(group.1 = c("a", "b", "c"), group.2 = c("d", "e", "f"))

# convert named list to long data.frame
my.df <- namedList2longDF(my.list)


NMikolajewicz/scMiko documentation built on June 28, 2023, 1:41 p.m.