plotImage | R Documentation |
Returns a plot that displays an image. It enables users to directly include
a .png
or a .jpeg
file in a plot region by providing their path.
plotImage(obj = NULL, file = NULL, add = FALSE, ...)
obj |
an object of class |
file |
a path to either a |
add |
logical. Should images be added on the current graph? If |
... |
additional arguments to be passed to |
Note that either obj
or file
must be defined.
If a path is provided either readPNG
or readJPEG
according to
the end of the file extension.
img <- png::readPNG(system.file('img', 'Rlogo.png', package='png'), native=TRUE) op <- par(no.readonly = TRUE) par(mfrow=c(4,4), mar=rep(2,4)) for (i in seq_len(16)) plotImage(img) par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.