[R] Quotation marks in Strings?

Douglas Bates
Fri, 27 Dec 2002 00:03:03 -0000

tuffek at jippii.fi writes:

> How do I construct following string:
> s <- " *** "Hello!" *** "

Either

> s <- ' *** "Hello!" *** '
> s
[1] " *** \"Hello!\" *** "
> cat(s)
 *** "Hello!" *** >

or

> s <- " *** \"Hello!\" *** "
> cat(s)
 *** "Hello!" *** >

Note that when you print a string all " characters are expressed as \"
but if you use the cat function you get the actual string as it is
stored.