Is it possible to pre-install packages to shinylive app

128 Views Asked by At

Is it possible to pre-install packages in a shinylive for R app, instead of installing them with webr::install at runtime?

(In my opionion, this has some advantages: It causes less requests to other sites, so less possibility to cause issues with cross-origin policies. And as soon as the R session is started, the packages are available, the downloaded size may be larger, but the potentially slow installation step is not necessary.)

1

There are 1 best solutions below

0
snaut On

According to this answer to as similar question it should be possible by just extracting the packages downloaded from the webR binary repo to the R library on the rwasm vfs.

https://mstdn.social/@gws/111018303748462787

I was not able to get this to work. This might be due to other issues with the app or xhr request being blocked. So I post this here in the hope it helps someone.


Edit: It is planned to include this in the export functionality of shinylive, as mentioned in this feature request.