Is there a way to pack all needed packages for your shiny app from your package installations?

I am developing a shiny app for the first time. I have sent the app to a few people in my lab. What I realized is while installing packages people face a lot of troubles (most of them do not have Git installed, so downloading packages from Github gets really problematic and they're not being able to do it themselves). I want to supply the necessary packages as installed in my local desktop with the shiny app. Can anyone help me out with this?

I don't think you really need git to install packages from github, you need package remotes (or devtools) and use something like

install.packages('remotes')
remotes::install_github('the-desired-package')

cheers
Fer

Use renv to make it convenient

Hi @Fer,
In Windows machines, remotes ask for Git installed on your machine, not always though. To avoid these conflicts, I wanted a solution.

@nirgrahamuk,
Thanks, I will take a look into renv, looks like it'll help.

Sorry, I have not use windows for years :frowning:

I would probably supply the packages after building them in my machine, but it depends on how many dependencies they have, it can be a nightmare (I've done once, with a package with zero dependencies, for people in windows and mac, I provided the zip file I built localy in my machine, and they installed it using RStudio ide with no issues).

Sorry for not being of more help,

cheers
Fer

@Fer, yeah, the problem is there are a lot of dependencies, but I can painstakingly do all those if you let me know how to zip them and supply to users after I built all of those in my machine. Thank you for your help.

My step procedure was:

  1. Download the package form git (when you are on github, in the main page of the package, there should be a green button, once you press it, you can either clone or Download ZIP, see the screencapt below, so download the zip), you will get a zip file like package-master.zip

  1. Unzip it, you will have now a folder named package-master
  2. now you build it with R CMD build package-master
  3. now you have a zip file like package_0.3.1.tar.gz that can be installed locally
  4. I supplied it to people with a pen-drive (it was in a computer room, it happened that Github though all these people were attacking their site, so block requests from the Uni IPs for some hours ), and they used RStudio IDE to install it.

Hope it helps, and hoping someone will chime in with a more robust solution for future needs :slight_smile: This is fine for one or two occasions, but probably not for regular workflow

cheers
Fer

Edit, you can actually semi-automate it in a bash script, I reckon, so it would be less painful for you?

Yup, I think for once I can do it. This solution is a little bit messy, but it is a solution. Thank you so much @Fer

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.