Learn R Programming

XGR (version 1.1.7)

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

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

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>

See Also

xAuxEmbed

Examples

Run this code
# NOT RUN {
# file <- system.file("DESCRIPTION",package="XGR")
# res <- xAuxEmbed(file)
# }

Run the code above in your browser using DataLab