Skip to content
Prev 273910 / 398506 Next

variable name question

On 10/10/11 04:53, R. Michael Weylandt wrote:
<SNIP>
<SNIP>

I believe that ``sep= " '' is needed here rather than collapse.

Try:
         paste("junk",42,collapse="")

You get

     [1] "junk 42"

with a space in it.  Here paste is using the default value of sep, 
namely " ",
and is not using collapse at all, since there is nothing to collapse (the
value is a scalar to start with).

Whereas

         paste("junk",42,sep="")

gives

     [1] "junk42"

which is what is wanted.

     cheers,

         Rolf Turner