Search code examples
rquotesdouble-quotessingle-quotes

Are double "" and single '' quotes (always) interchangeable in R?


This is perhaps rather a minor question...

but just a moment ago I was looking through some code I had written and noticed that I tend to just use ="something" and ='something_else' completely interchangeably, often in the same function.

So my question is: Is there R code in which using one or other (single or double quotes) has different behaviour? Or are they totally synonymous?


Solution

  • > print(""hi"")
    Error: unexpected symbol in "print(""hi"
    > print("'hi'")
    [1] "'hi'"
    > print("hi")
    [1] "hi"