In [1]:
library(IRdisplay)
In [2]:
display_html('<h1>HTML output</h1>')
Plotting in R is displayed automatically, but if you want to display a PNG from another source, this is how to do it:
In [3]:
png('Rplot.png')
plot(1:10, 1:10)
dev.off()
display_png(file = 'Rplot.png')
Out[3]:
The following will result in the preferred image format being chosen by the frontend:
In [4]:
display_images(
svg = '<svg width=10 height=10><circle r=5 cx=5 cy=5/></svg>',
png = list(file = 'Rplot.png', width = 50, height = 50))
The best format is chosen according to the frontend’s setting. Configuring this is coming soon.
In [5]:
display_images(png = list(file = 'Rplot.png', width = 50, height = 50))