using R to generate and decode the QR code