The Problem

Suppose you want to print a multiline pattern to the console, such as:

*
**

How can we get this?

First Solution

You could use the cat() function like this:

cat("*\n**")
## *
## **

Second Solution

You can also separate the call to cat() over lines:

cat("
*
**")
## 
## *
## **

But note that this produces an extra newline at the beginning!