knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
qrencoder
: Make QR codes in R
There is another package on CRAN -- qrcode
-- that is not C-backed.
Quick Response codes (QR codes) are a type of matrix bar code and can be used to authenticate transactions, provide access to multi-factor authentication services and enable general data transfer in an image. QR codes use four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to efficiently store data. Matrix barcode generation is performed efficiently in C via the included libqrencode library created by Kentaro Fukuchi.
The following functions are implemented:
qrencode
: Return a QR encoded string as a matrixqrencode_df
: Return a QR encoded string as an x, y, z data.frameqrencode_png
: Return a QR encoded string as a base 64 encoded inline pngqrencode_raster
: Return a QR encoded string as a raster objectqrencode_svg
: Return a QR encoded string as an svg stringdevtools::install_github("hrbrmstr/qrencoder")
options(width=120)
library(qrencoder) # current verison packageVersion("qrencoder") url <- "http://rud.is/b" head(qrencode(url)) head(qrencode_df(url)) qrencode_png(url) qrencode_raster(url) par(mar=c(0,0,0,0)) image(qrencode_raster("http://rud.is/b"), asp=1, col=c("white", "black"), axes=FALSE, xlab="", ylab="")
cat(qrencode_svg(url))
library(qrencoder) library(testthat) date() test_dir("tests/")
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.