img {base64}R Documentation

encode a png file as a img data uri

Description

This creates html code to embed a png file into an html document.

Usage

img(file, Rd = FALSE)

Arguments

file png file to translate into a data uri
Rd if TRUE, extra markup is added to facilitate inclusion of the image in an Rd file

Details

The following graph is embedded in the document using the img function

Value

The html code

Note

no checking on the file is performed, so it is up to the user to make sure the input file is indeed a png file

Author(s)

Romain Francois <romain@r-enthusiasts.com>

See Also

encode is used to encode the file

Examples

## Not run: 
pngfile <- tempfile()
png( pngfile, width = 600, height = 600 )
plot( 1:100, rnorm(100), pch = 21, bg = "red", cex = 2 )
dev.off()
img( pngfile )

## End(Not run)

[Package base64 version 1.0 Index]