Re: [R] paste() turns list element character vector into deparsed expression. Why?

2020-11-09 Thread Ege Rubak
I agree that it is weird, but I don't see that it is easy to coerce a list to character of the same structure. In my example (missing the trailing parenthesis, sorry...) the input is a length two list and the output is a length two character vector, so in the general case the rationale seems to be

Re: [R] paste() turns list element character vector into deparsed expression. Why?

2020-11-09 Thread Boris Steipe
Thanks Ege - That narrows it down, ... but it's still weird. My issue is that I don't consider "c(\"xyz\", \"uvw\")" to be a valid character representation of a list. c() is a function, so "c(\"xyz\", \"uvw\")" is a string representation of a function call that could be eval(parse(...))'ed

Re: [R] paste() turns list element character vector into deparsed expression. Why?

2020-11-09 Thread Ege Rubak
I think `paste()` just calls `as.character()` on each input argument and then collapses things afterwards. Calling `as.character()` on the first input argument generates exactly the output you show (and didn't expect) and there is nothing to collapse. So changing `collapse = ""` to anything else