Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

RStudio – Text Formatting \n included in output instead of line break

When using this code in RStudio (as an example):

print("Hello\n World")

I get Hello\n World as the output instead of a line break. Any ideas why?

Thank you!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Use cat()instead of print().

> cat("Hello \n World")
Hello 
 World

To know more:
https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/cat

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading