开发者

What's the best way to melt a list into a vector?

I'd like to melt this:

test = list( one = "joe" , two = c( "john" , "jane" ) )

Into a character vector:

c( "joe" , "john" , "jane" )

I tried melt() in the reshape package, but that results in a data.frame where strings are treated as factors, so I'd have to do something like:

as.character( melt( test )$v开发者_运维知识库alue )

Is there a shorter/faster way?


unlist(test)

(my answer needs to be more than 30 characters!)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜