xAuxEmbed: Function to encode a file as a base64 string for embedding

Description Usage Arguments Value Note See Also Examples

Description

xAuxEmbed is supposed to encode a file as a base64 string for embedding such as into the R markdown rendering html file. It returns a hyperlink.

Usage

1
2
xAuxEmbed(file, download.attribute = basename(file),
link.text = paste0("Download ", download.attribute))

Arguments

file

a file to encode

download.attribute

the download attribute specifying the target to be downloaded instead of being explored. By default, it is the filename of the input file. The filename of the downloaded file can be different from the input file if provided differently

link.text

the link text (the visible part of the hyperlink)

Value

a hyperlink in the form of: <a href="encoded base64 string" download="download.attribute">"link.text"</a>

Note

This auxiliary function helps embed a file into the R markdown rendering html file for the download.

See Also

xAuxEmbed

Examples

1
2
# file <- system.file("DESCRIPTION",package="XGR")
# res <- xAuxEmbed(file)

XGR documentation built on June 18, 2019, 3:01 p.m.

Related to xAuxEmbed in XGR...