The answers to this question are great, and much simpler than mine - so I have since adopted the use of 'collapse'.
However, to promote the idea that when in doubt, you can write your own function, I present my previous, less elegant solution:
vecpaste <- function (x) {
y <- x[1]
if (length(x) > 1) {
for (i in 2:length(x)) {
history
y <- paste(y, x[i], sep = "")
}
}
#y <- paste(y, "'", sep = "")
y
}
vecpaste(blah)
you can also add quotes and commas, or just about anything - this is the original version that I wrote:
vecpaste <- function (x) {
y <- paste("'", x[1], sep = "")
if (length(x) > 1) {
for (i in 2:length(x)) {
history
y <- paste(y, x[i], sep = "")
}
}
y <- paste(y, "'", sep = "")
y
}