Can you tell me why
paste(paste(c(\"first\", \"second\"), collapse=\", \"), \"third\", collapse=\" and \")
gives me
\"first,
Let's break it down:
1st part:
> paste(c("first", "second"), collapse=", ")
#[1] "first, second"
2nd part:
> paste("first, second", "third", collapse=" and ")
#[1] "first, second third"
using sep= instead of collapse=
> paste("first, second","third",sep=" and ")
#[1] "first, second and third"
Therefore you can use:
> paste(paste(c("first", "second"), collapse=", "), "third",sep=", and ")
#[1] "first, second, and third"