Vinodh Velumayil
Vinodh Velumayil

Reputation: 762

Convert a list into a string

I would like to convert value stored as a list into a single string.

For example:

l <- list(1,2,3,4)

would give:

"1234"

and not as using the output of unlist():

unlist(l)
#[1] "1" "2" "3" "4"

Upvotes: 19

Views: 50682

Answers (1)

Marcin
Marcin

Reputation: 8044

 paste( unlist(l), collapse='')

Upvotes: 37

Related Questions