A QR code is a two-dimensional barcode developed by the Denso Wave company.
The current implementation handles three modes: numeric, alphanumeric and byte. Kanji is currently not supported. Please contact the maintainer if you need it.
- Numeric: only digits from 0 to 9
-
Alphanumeric: all numeric characters, upper case
LETTERS
, and the characters" "
(space),"$"
,"%"
,"*"
,"+"
,"-"
,"."
,"/"
and":"
- Byte: All characters from the Latin 1 (ISO 8859-1) character set.
Main functions
The main qr_code()
function returns an object of the qr_code
class. This is a logical matrix with specific methods for printing and plotting. The print version uses UTF-8 drawing symbols and the result depend on the font used. For a better quality QR code it best to use plot()
or generate_svg()
.
##
## ▗▄▄▄ ▗▗▄▄▄
## ▐▗▄▐ ▐▟▐▗▄▐
## ▐▐█▐▐▞▐▐▐█▐
## ▐▄▄▟▗▚▚▐▄▄▟
## ▗▖ ▄▖ ▖ ▗▖
## ▝▄▜▄▌▘▜▚▛▚█
## ▐▜█▚▀▐██▙▙▞
## ▗▄▄▄▐▄▞▖▗▟▄
## ▐▗▄▐▝▖▖▞▗▟▘
## ▐▐█▐ ▞█▛▄▐▄
## ▐▄▄▟▐▘▜▀▐▜▝
##
##
##
## use plot() for a better quality image
plot(code)
generate_svg(code, filename = "man/figures/qr.svg")
Installation
The qrcode
package is available from CRAN, R universe and GitHub.
# install from CRAN
install.packages("qrcode")
# install from R universe
install.packages("qrcode", repos = "https://thierryo.r-universe.dev")
# install from GitHub use the remotes package
remotes::install_github("ThierryO/qrcode")