robert-mcfad...@o2.pl wrote:
> 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?

Sure, but you need to escape the double quotes.

The easiest way is actually to read it in, like (sorry about the line
breakage...)

> x <- readLines(n=1)
<question><span style="color: #0000FF; font-weight: bold; font-size: 14pt">
> x
[1] "<question><span style=\"color: #0000FF; font-weight: bold;
font-size: 14pt\">"

but you could also assign directly

> y <- "<question><span style=\"color: #0000FF; font-weight: bold;
font-size: 14pt\">"
> x == y
[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.)

-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalga...@biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to