-1

When I run my variable it generates the " \ " in empty spaces.

Is there a way to remove the " \ " or maintain the original format of the variable text?

topheader<-'<div id="editor1" class="shinytinymce shiny-bound-input" 
style="resize: none; width: 100%; height: 100%; border-style: none; 
background: gainsboro;">'

print(topheader) 

[1] "<div id=\"editor1\" class=\"shinytinymce shiny-bound-input\" 
style=\"resize: none; width: 100%; height: 100%; border-style: none; 
background: gainsboro;\">"
Koolakuf_DR
  • 467
  • 4
  • 16

1 Answers1

1

The string \" stands for a single double-quote character. R prints it this way since it prints all strings as double-quoted, so it needs to escape internal double-quotes.

If you want to see character values as the actual written characters, use cat:

cat(topheader)
# <div id="editor1" class="shinytinymce shiny-bound-input" 
# style="resize: none; width: 100%; height: 100%; border-style: none; 
# background: gainsboro;">
Nathan Werth
  • 5,093
  • 18
  • 25