ggplot2 version of qrcode generator

library(qrcode)
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.3     ✓ purrr   0.3.4
## ✓ tibble  3.0.4     ✓ dplyr   1.0.2
## ✓ tidyr   1.1.2     ✓ stringr 1.4.0
## ✓ readr   1.4.0     ✓ forcats 0.5.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
#QRmatrix<-qrcode_gen('www.r-project.org',dataOutput=TRUE)
ggqrcode <- function(text, color="black", alpha=1) {
    pkg <- "qrcode"
    require(pkg, character.only = TRUE)
    x <- qrcode_gen(text, plotQRcode=F, dataOutput=T)
    x <- as.data.frame(x)

    y <- x
    y$id <- rownames(y)
    y <- gather(y, "key", "value", colnames(y)[-ncol(y)])
    y$key = factor(y$key, levels=rev(colnames(x)))
    y$id = factor(y$id, levels=rev(rownames(x)))

    ggplot(y, aes_(x=~id, y=~key)) + geom_tile(aes_(fill=~value), alpha=alpha) +
        scale_fill_gradient(low="white", high=color) +
        theme_void() + theme(legend.position='none')
} # https://github.com/GuangchuangYu/yyplot/blob/master/R/ggqrcode.R
p<-ggqrcode("Col_shade_rep3")
p

p2<-p + labs(title="Col shade rep3")
p2

How to print out QRcodes on a label sheet?

library(cowplot) # see alternative in https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html
# read sample data

# create QR code and store them in list object (using loop or sapply?)

# plot in one page with appropriate position in labels by cowplot

# save the plot in pdf file

# print the pdf on a label sheet!