What's a fast and easy to implement method for setup during a workshop for beginners (no internet)

I'm planning a beginner's workshop for R and tidyverse as part of a scientific meeting in West Africa. We'll present our results and then have a workshop to show people how to reproduce the results as a way of introducing R. Here's the catch:

  1. I cannot send instructions ahead of time and expect people to come ready for the workshop.
  2. I cannot rely on any internet connection during the workshop to download R, RStudio, or packages.

I'm thinking that I can bring participants a USB with the installers for R, RStudio, and package source files. Here are my questions:

  1. Can anyone point me to good resources for this type of thing so I don't reinvent the wheel for explaining to complete novices how to install the software and packages from source?

  2. If I want to have people install packages from source, do I need to include all of the dependencies as source files too (and dependencies of dependencies...)? Or are dependencies bundled into the main package source files? (remember, no internet connection to download dependencies on the fly).

3 Likes

Yes, you have to provide the full dependency tree.

This is an interesting challenge and I've never done what you are proposing. But I salute your efforts!

Do you know what OS everyone will be running? This is a more tractable task if everyone will be on the same OS.

This article is about running RStudio from a USB: https://support.rstudio.com/hc/en-us/articles/200534467-Creating-a-Portable-Version-of-RStudio-for-a-USB-Drive

If it was possible to load both R & RStudio in a portable USB stick, you could install everything that's needed and then clone the USB stick. Just give all participants a cheap USB with everything ready to go.

I have no idea if this is feasible, just brain storming here...

aaaand R for Windows FAQ to the rescue:

2.6 Can I run R from a CD or USB drive?
Yes, with care. A basic R installation is relocatable, so you can burn an image of the R installation on your hard disc or install directly onto a removable storage device such as a flash-memory USB drive.

Running R does need access to a writable temporary directory and to a home directory, and in the last resort these are taken to be the current directory. This should be no problem on a properly configured version of Windows, but otherwise does mean that it may not be possible to run R without creating a shortcut starting in a writable folder.

1 Like

USB sticks are so big and cheap, another option is make a bootable version of Ubuntu with R, RStudio, and all needed packages & data already installed. Then just give everyone a USB drive with the full OS and all installed.

3 Likes

OK thanks. Great to confirm this.

No, I imagine we'll have multiple versions for maximum pain.

This is an interesting idea. Am I correct that I'd need to create a custom Ubuntu ISO file after configuring the OS with all of the programs and packages?

This could help installing the packages and dependencies locally:
https://cran.r-project.org/web/packages/miniCRAN/index.html

2 Likes

Very cool, @martin.R. So with this approach, I'd give everyone a USB with installers for R and RStudio (and maybe LaTeX if we want to create PDFs) and the miniCran repo I make.

I imagine I'll have to play around a bit to know what to tell people how to define pth since people will be accessing via USB or dragging to their desktop to install.

install.packages(pkgs, 
                 repos = paste0("file:///", pth),
                 type = "source")
1 Like

Yes, it may well require some fiddling.

I only once tried using miniCRAN when trying to install some packages on a server without internet access and I was only semi-successful, but that was a long time ago.

The author actually works for RStudio now and can be found on here should you need any more direct advice on it.

1 Like

There is a portable version of R & RStudio here

Then setup .REnviron file pointing to the location of the library folder within that portable version
https://csgillespie.github.io/efficientR/3-3-r-startup.html#renviron

After that, install all required packages

HTH

This is probably a much worse idea than the replies above, but you could also set up a server that runs RStudio Server and hook it up directly up to a router—instead of connecting to the Internet via a normal Wifi access point, the workshop participants could connect to your router and login to RStudio Server over the local network.

The biggest downside, IMO, is that your server would have to be able to support all the participants potentially running an analysis simultaneously. If it's exploratory stuff, that would probably scale well since participants would probably be sitting at the prompt 70 or 80% of the time, but if you're going to give them a big script or function to run and there's a good chance that they could actually all be tying up threads at the same time... maybe that wouldn't work so well.

Anyway, it's an alternative, in case the USB idea doesn't work so well! Note that although most modern systems boot fine from USB, you might want to consider having some portable R installations ready to go in the event that someone's system isn't configured for USB booting.

1 Like

Have you considered docker?

http://ropenscilabs.github.io/r-docker-tutorial/

1 Like

It is a bit of a displacement solution :stuck_out_tongue: since now you have to figure out how to have them install docker and get your container. But at least, it is one thing to install and one thing to transfer rather than having to install R and RStudio and packages and possibly latex if you use rmarkdown, etc.

So probably a totally silly idea, but I thought I would throw it out there, just in case...

1 Like

Along the lines of @jdlong 's suggestion, I would consider looking into Rocker, which is a series of Docker images of different R containers. I have not myself played around with it, but I know very competent people who have used it successfully for reproducible self contained analyses and since it self contained, I assume it would fit your aim?

There is a TidyVerse image here, which may be of use to you?

Good luck!

3 Likes

Interesting idea, @prosoitos and @Leon. I downloaded and installed Docker, which will be easy to get them to do in the workshop if I provide the installers. I also ran docker pull rocker/geospatial without any problems. I'm a little nervous about having beginners fire up the terminal, but maybe there is a way around this.**

I believe the idea now to customize this Dockerfile and then save it as a new image. This resource seems helpful for modifying the Dockerfile, but it assumes the user wants to share the new image via dockerhub. Can anyone point to a simple example for sharing and installing Dockerfiles locally via USB?

Overall, this seems like a good approach for quickly jumping into workshop. At the end, I could help interested folks work through a more traditional install if the USB has installers for R and RStudio, along with a miniCran repo. The key word here is "end".

** Is there a way to create an icon that will install the Dockerfile and launch RStudio in the browser?

The Docker business has some real advantages... but the huge disadvantage is you've added another layer of technology and complexity to navigate. When dealing in a complex/dynamic/uncertain deployment situation, you should look for a solution that is as simple as possible (but not simpler :wink: )

This is a good point, and I think @jdlong's original suggestion to provide a USB with Ubuntu/R/RStudio, and all necessary packages already installed is a great one! It lets you control OS (I've always found students having a mix of Mac, Windows, and "other" to be trouble when it comes to workshops and diagnosing issues), provide the necessary software, and test it all up front.

Controlled environments FTW.

The other thing I would consider, if this were me, is brining a Linux laptop with RStudio server and a wireless router then have the students connect to your teaching machine. I have no idea of WiFi on the student machines can be assumed, however. That set up would be easy and not require them all booting from a USB drive. But when you go home they would have no R install to play with. Which is a real limitation.

-j

I've learned a lot from this thread. Thanks. Lots to explore.

  1. I'll definitely leave folks with installers and instructions, possibly making time at the end for interested participants to get everything working on their machines.

  2. I'll experiment with the bootable USB OS/R/Rstudio/packages option.

  3. I'm intrigued by the Docker option because it "just worked" for me today, but there is a layer of abstraction that might confuse folks.

  4. @jdlong: With respect to the laptop+router option, do you have a sense of what minimum hardware I'd need to support 20-30 simultaneous users running basic analyses (no complicated models or simulation)?