Re: [R] Space character introduced bu paste

From: Karl Ove Hufthammer <Karl.Hufthammer_at_math.uib.no>
Date: Thu, 05 Jun 2008 15:48:53 +0200

tolga.i.uzuner_at_jpmorgan.com:

>> charlist<-c("a","b","c")
>> lapply(charlist, function (y) paste("'",y,"'"))

Use 'sep=""'. And using 'sapply' instead of 'lapply' gives a nicer input. The following works.

$ sapply(charlist, function(y) paste("'",y,"'", sep=""))

    a b c
"'a'" "'b'" "'c'"

-- 
Karl Ove Hufthammer

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 05 Jun 2008 - 15:45:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jun 2008 - 16:30:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive