Code without visible output:
In [1]:
a <- 8
In [2]:
b <- 4:59
With visible output:
In [3]:
a + b
Out[3]:
Printing is captured and sent to the frontend:
In [4]:
print('Hello world! Love, R in Jupyter.')
So are errors:
In [5]:
f2 <- function() stop('deep error')
throw <- function() f2()
In [6]:
'this line is run / displayed'
throw()
'this line is not run / displayed'
Out[6]:
Plotting works too:
In [7]:
x <- seq(0, 2*pi, length.out=50)
plot(x, sin(x))