Learn R Programming

ribiosUtils (version 1.7.7)

list2df: Transform a list of character strings into a data.frame

Description

Transform a list of character strings into a data.frame

Usage

list2df(list, names = NULL, col.names = c("Name", "Item"))

Value

A data.frame

Arguments

list

A list of character strings

names

Values in the 'Name' column of the result, used if the input list has no names

col.names

Column names of the data.frame

Examples

Run this code

myList <- list(HSV=c("Mueller", "Papadopoulos", "Wood"), FCB=c("Lewandowski", "Robben", "Hummels"),
               BVB=c("Reus", "Goetze", "Kagawa"))
list2df(myList, col.names=c("Club", "Player"))

Run the code above in your browser using DataLab