I would like to paste something that has "" within.
> i = 4
> paste("var", i, "option="juk"", "--opt2 12")
Error: unexpected symbol in "paste("var", i, "option="juk"
What the pasted phrase should look like (which included comma within)
var 4 option = "juk" --opt2 12
Is there any way to solve this ?
One option would be
(x <- paste("var", i, 'option="juk"', "--opt2 12"))
# [1] "var 4 option=\"juk\" --opt2 12"
cat(x)
# var 4 option="juk" --opt2 12
来源:https://stackoverflow.com/questions/35779204/comma-within-paste-in-r