| Title: | Base64 Encoder and Decoder |
|---|---|
| Description: | Compatibility wrapper to replace the orphaned package. New applications should use base64 encoders from 'jsonlite' or 'openssl' or 'base64enc'. |
| Authors: | Jeroen Ooms [aut, cre] |
| Maintainer: | Jeroen Ooms <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.0.2 |
| Built: | 2026-05-14 15:32:05 UTC |
| Source: | https://github.com/jeroen/base64 |
Wrapper for openssl::base64_encode.
encode(input, output = tempfile(), linebreaks = TRUE) decode(input, output = tempfile())encode(input, output = tempfile(), linebreaks = TRUE) decode(input, output = tempfile())
input |
input file |
output |
output file |
linebreaks |
insert linebreaks to make output human readable See openssl::base64_encode |
# encode a file myfile <- R.home("COPYING") tmp <- tempfile() base64::encode(myfile, tmp) # decode it back orig <- tempfile() base64::decode(tmp, orig) readLines(orig)# encode a file myfile <- R.home("COPYING") tmp <- tempfile() base64::encode(myfile, tmp) # decode it back orig <- tempfile() base64::decode(tmp, orig) readLines(orig)
This creates html code to embed a png file into an html document.
img(file, Rd = FALSE, alt = "image")img(file, Rd = FALSE, alt = "image")
file |
png file to translate into a data uri |
Rd |
if |
alt |
alternate text |
pngfile <- tempfile() png(pngfile, width = 600, height = 400) plot(1:100, rnorm(100), pch = 21, bg = "red", cex = 2 ) dev.off() img(pngfile, Rd = TRUE)pngfile <- tempfile() png(pngfile, width = 600, height = 400) plot(1:100, rnorm(100), pch = 21, bg = "red", cex = 2 ) dev.off() img(pngfile, Rd = TRUE)