Qrencoder
:white_square_button: Make QR codes in R via libqrencode
Install / Use
/learn @hrbrmstr/QrencoderREADME
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 'libqrencoder' 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 string
Installation
devtools::install_github("hrbrmstr/qrencoder")
Usage
library(qrencoder)
#> Loading required package: raster
#> Loading required package: sp
# current verison
packageVersion("qrencoder")
#> [1] '0.2.1'
url <- "http://rud.is/b"
head(qrencode(url))
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20]
#> [1,] 1 1 1 1 1 1 1 0 1 0 0 0 0 0 1 1 1 1 1 1
#> [2,] 1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 0 0
#> [3,] 1 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 1 1 1 0
#> [4,] 1 0 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 1 1 0
#> [5,] 1 0 1 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 0
#> [6,] 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0
#> [,21]
#> [1,] 1
#> [2,] 1
#> [3,] 1
#> [4,] 1
#> [5,] 1
#> [6,] 1
head(qrencode_df(url))
#> x y z
#> 1 0 20 1
#> 2 1 20 1
#> 3 2 20 1
#> 4 3 20 1
#> 5 4 20 1
#> 6 5 20 1
qrencode_png(url)
#> [1] "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAAAAACMfPpKAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAfElEQVQYlU2QWwrEMAwDR0vuf+XZj8qJSyjIyNYjAkAMQNFhkBCKzoNiin70kxKBN41ENuf7+9AZWQOGRx/2m4TeKy2YO0GyDpwszW5EUCs/ur78NZtGvSa8azdPDGttsonot8LtDFNnrs4yLSbuJk0ajnV3vevhCxUj4Q+R11n764g4WgAAAABJRU5ErkJggg=="
qrencode_raster(url)
#> class : RasterLayer
#> dimensions : 21, 21, 441 (nrow, ncol, ncell)
#> resolution : 0.04761905, 0.04761905 (x, y)
#> extent : 0, 1, 0, 1 (xmin, xmax, ymin, ymax)
#> coord. ref. : NA
#> data source : in memory
#> names : layer
#> values : 0, 1 (min, max)
par(mar=c(0,0,0,0))
image(qrencode_raster("http://rud.is/b"),
asp=1, col=c("white", "black"), axes=FALSE,
xlab="", ylab="")

SVG
cat(qrencode_svg(url))
#> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
#> <!-- Created with qrencode 3.9.0 (http://fukuchi.org/works/qrencode/index.html.en) -->
#> <svg width="2.01cm" height="2.01cm" viewBox="0 0 19 19" preserveAspectRatio="none" version="1.1" xmlns="http://www.w3.org/2000/svg">
#> <g id="QRcode">
#> <rect x="0" y="0" width="19" height="19" fill="#ffffff" />
#> <g id="Pattern">
#> <rect x="-1" y="-1" width="7" height="1" fill="#000000" />
#> <rect x="8" y="-1" width="1" height="1" fill="#000000" />
#> <rect x="11" y="-1" width="1" height="1" fill="#000000" />
#> <rect x="13" y="-1" width="7" height="1" fill="#000000" />
#> <rect x="-1" y="0" width="1" height="1" fill="#000000" />
#> <rect x="5" y="0" width="1" height="1" fill="#000000" />
#> <rect x="7" y="0" width="2" height="1" fill="#000000" />
#> <rect x="10" y="0" width="1" height="1" fill="#000000" />
#> <rect x="13" y="0" width="1" height="1" fill="#000000" />
#> <rect x="19" y="0" width="1" height="1" fill="#000000" />
#> <rect x="-1" y="1" width="1" height="1" fill="#000000" />
#> <rect x="1" y="1" width="3" height="1" fill="#000000" />
#> <rect x="5" y="1" width="1" height="1" fill="#000000" />
#> <rect x="7" y="1" width="2" height="1" fill="#000000" />
#> <rect x="10" y="1" width="1" height="1" fill="#000000" />
#> <rect x="13" y="1" width="1" height="1" fill="#000000" />
#> <rect x="15" y="1" width="3" height="1" fill="#000000" />
#> <rect x="19" y="1" width="1" height="1" fill="#000000" />
#> <rect x="-1" y="2" width="1" height="1" fill="#000000" />
#> <rect x="1" y="2" width="3" height="1" fill="#000000" />
#> <rect x="5" y="2" width="1" height="1" fill="#000000" />
#> <rect x="8" y="2" width="1" height="1" fill="#000000" />
#> <rect x="10" y="2" width="1" height="1" fill="#000000" />
#> <rect x="13" y="2" width="1" height="1" fill="#000000" />
#> <rect x="15" y="2" width="3" height="1" fill="#000000" />
#> <rect x="19" y="2" width="1" height="1" fill="#000000" />
#> <rect x="-1" y="3" width="1" height="1" fill="#000000" />
#> <rect x="1" y="3" width="3" height="1" fill="#000000" />
#> <rect x="5" y="3" width="1" height="1" fill="#000000" />
#> <rect x="7" y="3" width="1" height="1" fill="#000000" />
#> <rect x="13" y="3" width="1" height="1" fill="#000000" />
#> <rect x="15" y="3" width="3" height="1" fill="#000000" />
#> <rect x="19" y="3" width="1" height="1" fill="#000000" />
#> <rect x="-1" y="4" width="1" height="1" fill="#000000" />
#> <rect x="5" y="4" width="1" height="1" fill="#000000" />
#> <rect x="7" y="4" width="1" height="1" fill="#000000" />
#> <rect x="10" y="4" width="1" height="1" fill="#000000" />
#> <rect x="13" y="4" width="1" height="1" fill="#000000" />
#> <rect x="19" y="4" width="1" height="1" fill="#000000" />
#> <rect x="-1" y="5" width="7" height="1" fill="#000000" />
#> <rect x="7" y="5" width="1" height="1" fill="#000000" />
#> <rect x="9" y="5" width="1" height="1" fill="#000000" />
#> <rect x="11" y="5" width="1" height="1" fill="#000000" />
#> <rect x="13" y="5" width="7" height="1" fill="#000000" />
#> <rect x="7" y="6" width="3" height="1" fill="#000000" />
#> <rect x="11" y="6" width="1" height="1" fill="#000000" />
#> <rect x="-1" y="7" width="2" height="1" fill="#000000" />
#> <rect x="2" y="7" width="1" height="1" fill="#000000" />
#> <rect x="5" y="7" width="2" height="1" fill="#000000" />
#> <rect x="8" y="7" width="2" height="1" fill="#000000" />
#> <rect x="13" y="7" width="3" height="1" fill="#000000" />
#> <rect x="17" y="7" width="2" height="1" fill="#000000" />
#> <rect x="0" y="8" width="1" height="1" fill="#000000" />
#> <rect x="3" y="8" width="1" height="1" fill="#000000" />
#> <rect x="10" y="8" width="3" height="1" fill="#000000" />
#> <rect x="15" y="8" width="1" height="1" fill="#000000" />
#> <rect x="19" y="8" width="1" height="1" fill="#000000" />
#> <rect x="0" y="9" width="6" height="1" fill="#000000" />
#> <rect x="7" y="9" width="1" height="1" fill="#000000" />
#> <rect x="11" y="9" width="2" height="1" fill="#000000" />
#> <rect x="14" y="9" width="1" height="1" fill="#000000" />
#> <rect x="17" y="9" width="1" height="1" fill="#000000" />
#> <rect x="19" y="9" width="1" height="1" fill="#000000" />
#> <rect x="0" y="10" width="3" height="1" fill="#000000" />
#> <rect x="6" y="10" width="6" height="1" fill="#000000" />
#> <rect x="13" y="10" width="1" height="1" fill="#000000" />
#> <rect x="15" y="10" width="2" height="1" fill="#000000" />
#> <rect x="18" y="10" width="2" height="1" fill="#000000" />
#> <rect x="1" y="11" width="1" height="1" fill="#000000" />
#> <rect x="3" y="11" width="1" height="1" fill="#000000" />
#> <rect x="5" y="11" width="1" height="1" fill="#000000" />
#> <rect x="7" y="11" width="1" height="1" fill="#000000" />
#> <rect x="11" y="11" width="2" height="1" fill="#000000" />
#> <rect x="14" y="11" width="1" height="1" fill="#000000" />
#> <rect x="16" y="11" width="1" height="1" fill="#000000" />
#> <rect x="7" y="12" width="1" height="1" fill="#000000" />
#> <rect x="11" y="12" width="2" height="1" fill="#000000" />
#> <rect x="14" y="12" width="1" height="1" fill="#000000" />
#> <rect x="19" y="12" width="1" height="1" fill="#000000" />
#> <rect x="-1" y="13" width="7" height="1" fill="#000000" />
#> <rect x="7" y="13" width="2" height="1" fill="#000000" />
#> <rect x="11" y="13" width="2" height="1" fill="#000000" />
#> <rect x="15" y="13" width="4" height="1" fill="#000000" />
#> <rect x="-1" y="14" width="1" height="1" fill="#000000" />
#> <rect x="5" y="14" width="1" height="1" fill="#000000" />
#> <rect x="8" y="14" width="1" height="1" fill="#000000" />
#> <rect x="15" y="14" width="1" height="1" fill="#000000" />
#> <rect x="19" y="14" width="1" height="1" fill="#000000" />
#> <rect x="-1" y="15" width="1" height="1" fill="#000000" />
#> <rect x="1" y="15" width="3" height="1" fill="#000000" />
#> <rect x="5" y="15" width="1" height="1" fill="#000000" />
#> <rect x="8" y="15" width="2" height="1" fill="#0
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
