As many other languages, certain characters in strings have a different meaning when they're escaped. One example for that is \n
, which means newline instead of n
. When you write \%
, R tries to interpret %
as a special character and fails doing so. You might want to try to escape the backslash, so that it is just a backslash:
paste(a, "\\%")
You can read on escape sequences here.