Skip to content

string

4 messages · Peter Dalgaard, Robert, Gabor Grothendieck

#
I would like to assign a variable y the string: <question><span style="color: #0000FF; font-weight: bold; font-size: 14pt">
How can I do it - is it possible?
 
Best,
Robert
#
robert-mcfadden at o2.pl wrote:
Sure, but you need to escape the double quotes.

The easiest way is actually to read it in, like (sorry about the line
breakage...)
<question><span style="color: #0000FF; font-weight: bold; font-size: 14pt">
[1] "<question><span style=\"color: #0000FF; font-weight: bold;
font-size: 14pt\">"

but you could also assign directly
font-size: 14pt\">"
[1] TRUE

(Notice that the backslashes are not actually part of the string, it is
just that internal quotes are _displayed_ as \", and entered in the same
way. This tends to confuse people at first.)
#
Thank you very much all of you.
(I forgot about directly ' ', instead I used " " and got errors.)

Best,
Robert

Dnia 6 stycznia 2010 12:22 robert-mcfadden at o2.pl napisa?(a):
#
Some new syntax to handle this without escapes was on my wish list for
R and keeps coming up from time to time. As mentioned it would also be
useful for latex source, Windows path names, regular expressions and
other situations such as this one which require characters that
otherwise need to be escaped.
On Wed, Jan 6, 2010 at 6:33 AM, Peter Dalgaard <P.Dalgaard at biostat.ku.dk> wrote: