Text Formatting \n included in output instead of line break

Viewed 30

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!

2 Answers

Another option is using writeLines:

writeLines("Hello\n World")
#> Hello
#>  World

Created on 2022-07-14 by the reprex package (v2.0.1)

Related