Re: [R] paste to collapse vector to string

2009-04-02 Thread Dieter Menne
Xiao-Jun Ma-2 wrote: > > I'm trying to collapse a character vector to strings, but I am getting > unexpected behaviors in list context: > A <- "a" > B <- c("b","c") > > xx <- list(A=A, B=B) > > lapply(xx, paste, collaplse=".") > Typing error in collapLse Dieter -- View this message in c

[R] paste to collapse vector to string

2009-04-01 Thread Xiao-Jun Ma
Hi, I'm trying to collapse a character vector to strings, but I am getting unexpected behaviors in list context: A <- "a" B <- c("b","c") xx <- list(A=A, B=B) lapply(xx, paste, collaplse=".") $A [1] "a ." $B [1] "b ." "c ." paste(B, collapse=".") [1] "b.c" # this is what I