I am looking to create identicons using the Jdenticon library within an R package. I want a function that takes certain arguments stored in R variables, such as the output file name, and returns a filename corresponding to the generated Jdenticon (in either PNG or SVG format) that can be used, for example, in Rmarkdown documents.
Therefore, I need a function that works like this:
create_jdenticon('dj23idfsb', size = 100, format = 'svg')
# [1] "/var/folders/59/r7wjy0gn6yv59w19694x5gy80000gp/T//RtmpjDwDfq/jdenticon_dj23idfsb_100.svg"
I believe I can write most of the R function myself, but I am unsure about how to set up and execute the npx command required within R (or if this is even the correct approach).
I have noticed that the packer package includes an npx command, but I am uncertain if this package meets my needs or where to begin.
Any guidance on this matter would be greatly appreciated.
[The reason I specify Jdenticons specifically is because I am already utilizing Jdenticons elsewhere on my website, and it is essential that the generated identicons match (hence solutions using different R packages that produce unique identicons will not suffice).]