Learn R Programming

annotationTools (version 1.46.0)

listToCharacterVector: Turn list into character vector

Description

Takes a list and returns a character vector by (separately) concatenating the vectors in the list.

Usage

listToCharacterVector(lst,sep=' /// ')

Arguments

lst
list object
sep
character string specifying the separator to concatenate each elements of vectors in the list

Value

v
vector of length 'length(lst)' where the 'i'-th element contains the concatenation of the 'i'-th element of 'lst'.

Details

The output vector has same length as the input list.

Examples

Run this code
##an example list
lst<-vector('list',3)
lst[[1]]<-c('a1','a2')
lst[[2]]<-'b'
lst[[3]]<-c('c1','c2','c3')
##merge first 2 list elements
listToCharacterVector(lst,sep=', ')

Run the code above in your browser using DataLab