I would like to generate identicons with Jdenticon from within an R package. So, given a set of arguments in R variables including an output file name, I'd like a function that will return a filename refering to the generated Jdenticon (either PNG or SVG) that I can use (eg to read into Rmarkdown documents).
So I'd like a function that does something like:
create_jdenticon('dj23idfsb', size = 100, format = 'svg')
# [1] "/var/folders/59/r7wjy0gn6yv59w19694x5gy80000gp/T//RtmpjDwDfq/jdenticon_dj23idfsb_100.svg"
I can write most of the R function, I'm just not sure how to setup and run the npx command required from within R (or even if this is the right approach).
I see that the packer package has an npx command, but I'm not sure whether this package really does what I want or how to start.
Any pointers would be appreciated.
[The reason I need it to be Jdenticons in particular is that I'm using Jdenticons elsewhere on the web, and they need to match (so solutions using R packages that do the same thing but generate different identicons will not work).]
Here's a minimally working version of Jdenticon for R:
https://github.com/mattroumaya/jdenticon
The main steps in creating this type of wrapper for a Node.js package are:
inst
folder.processx
package.npm install
to initialize node_modules
.