Hello,

If you want to apply the same procedure to all elements of an object, check
out the  '*apply' functions.

In this case,

x=c("one","two","three")
y=c("yellow","blue","green")
z=c("apple","cheese")

lapply(x, function(x) paste(x, y))

gives a good picture of what you want to do, just transform it into a
function and use the function:

f <- function(x, y) unlist(lapply(x, function(x) paste(x,y)))

f(x, f(y, z))

With more than 3 vectors, you could try a recursive version.
I hope this helps.

Rui Barradas


--
View this message in context: 
http://r.789695.n4.nabble.com/Combining-characters-tp4261888p4262632.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.

Reply via email to