paste quotation marks into character string, within a loop

Simply escape the quotation marks with backslashes:

paste("modelCheck(var\"",i,"_d.bug\")",sep="")

An alternative is to use single quotes to enclose the string:

paste('modelCheck(var"',i,'_d.bug")',sep="")

Leave a Comment