I want to print a summary table(self-formatted) in R. So These summaries contain multiple lines and I'm working with RStudio and RScripts. So if I execute a statement like this:
print("Line 1")
print("Line 2")
I would like to have an output like
Line 1
Line 2
Instead I'm getting
> print("Line 1")
[1] "Line 1"
> print("Line 2")
[1] "Line 2"
What method could help or what do I have to do to achieve the desired output?
This will do what you are looking for cat("Line 1 \nLine 2")
>cat("Line 1 \nLine 2")
Line 1
Line 2
See R - do I need to add explicit new line character with print()?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With