jj_list_to_df: Convert list to data.frame in long/wide format

View source: R/jj_list_to_df.R

jj_list_to_dfR Documentation

Convert list to data.frame in long/wide format

Description

Convert list to data.frame in long/wide format

Usage

jj_list_to_df(flist, long = TRUE, fill_with = NA, maintain_classes = TRUE)

Arguments

flist

Full path to the file to read or write

long

If TRUE (default), return two column data.frame with names in first and values in second column. Else, return data.frame with one column per list element.

fill_with

If long=FALSE, value to fill cells in case of unequal lenghts of list elements. Default=NA

maintain_classes

keep the class of each entry in the list, otherwise coerces to character columns

Examples

example_list = list(signature1=c('CD19A','CD79B','SDC1'), signature2=c('CD8A','CD8B1'))
jj_list_to_df(flist=example_list)
jj_list_to_df(flist=example_list, long = F)

mathosi/jj documentation built on Feb. 25, 2024, 2:29 p.m.