Running R and RStudio on Dropbox [duplicate] - r

This question already has answers here:
Run R from dropbox
(2 answers)
Closed 7 years ago.
For a collaborative project can you install RStudio (and R itself) on a shared dropbox folder, as well as run the script from that same location?
If yes, is there a special procedure that should be employed in setting that up? I currently have both R and RStudio installed on my PC. Does the collaborator need to have R installed on their computer as well for this to work?

Sounds like there are two separate aspects to your question:
Can you share the R & RStudio application/executables
Can you share the R scripts/project documents
Regarding 1, to share the application/executables, you could follow the portable Rstudio approach from #hrbrmstr. That's going to require you providing the correct versions for your collaborator's OS. If you are just working with one person, you may find it easier to have them simply download and install RStudio on their own computer.
If your project requires installing custom libraries from CRAN, make sure to communicate this to your collaborator, as libraries you've installed won't be installed for them.
Regarding 2, sharing the R scripts and project documents is straight forward. They should be able to open these documents and execute them on their own machine.

It's possibly easier to install RStudio Server on AWS. I did it and the only thing that was a bit of a pain was managing the users (you need to shell in). Once the users are set up you can set up a shared environment and also each user has their own environment.

Related

Put RShiny app in docker for Windows based local computers

I have an RShiny based application developed on Windows 10 using R (4.0.4), RStudio and RShiny. I want to share this application with my colleagues (who also use Windows 10) for them to use but they don't have R or RStudio installed. I want them to be able to use this app without installing R and RStudio since we don't have admin rights on our laptops and getting them requires raising tickets. One possible option would be to host the app on a server and use shiny-server, then share the link to the app. But we don't have a server budget currently.
My primary question is, if there is a way to share the app with my colleagues without them having to go through the hassle of installing R and RStudio.
From my preliminary research, I have found that Dockers (or Rockers by RStudio Inc.) can be used to achieve this by making the app into a "docker image" (whatever this means!). But all the articles I found were about dockerising the RShiny app for Linux based systems and servers. Hence, my secondary question is, if anybody knows this Docker/Rocker can be used on Windows based systems to help me in my scenario explained in first paragraph.

Can people without R installed run an R Notebook file successfully?

I have an R Notebook that I am building to provide an analysis for somebody, and I am wondering if I should choose another option as I don't know if she will be able to run the Notebook without having R installed.
Is it possible to run an R Notebook as a single entity or must you have R installed in order to do it?
To rerun the notebook they require R. But the whole point of R Notebooks is that they produce a static document as output. That document (usually in HTML format) can be shared in isolation, and does not require any additional software besides a web browser to be viewerd.
Notebook will need R to run. To distribute a notebook without the R dependency will be a bit more elaborate, like installing rstudio server within a docker container. User will, in this particular case, need to have Docker installed and know how to start a container. From there on the user can interact with the code through a web browser.
Another option would be to use the cloud solution that some companies offer. It offers sharing functionality and you don't have to worry about the infrastructure or distribution of your work. There are some free plans that may work for you, but the real power is in premium features.

Setting up RStudio Portable Default R version

I recently discovered a portable version of R and RStudio #
http://rportable.sourceforge.net/
Open source rocks!
At any-rate, I am jumping from pc to pc at my university, and I'd like to get Portable R-studio to recognize Portable R as the default R version. Most computers at the university already have several versions of r-installed, and RStudio uses one of those versions of R. When I go into the Global Options to change the default version, it does not "see" portable R on the USB drive.
I am basically hopping I can run R without constantly having to download packages, specifying the work directory, downloading Scripts, data from Google Drive, etc...
Any suggestions? I am open. Thanks for your help.
I did not need to touch the registry.
I first installed R portable and then R Studio portable, both from Sourceforge.
After launching R Studio for the first time, I was shown the option of choosing the installation of R to be used, as shown in
https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R
I browsed to branch \PortableApps\R-Portable\App\R-Portable\bin, where executables are located. There I selected the 64-bit version.
If you want to change later the version used, you open R Studio and go to Tools -> Option -> General -> R Version.
This avoids modifying the registry, with the two advantages of Portable Apps:
Leaving no trace of the app in the system (or, at least, a much milder one).
Being really portable (or, at least, much more so).
On Windows, RStudio uses the system registry to find where installed versions of R are located. You'll need to edit the registry yourself to let it know about new versions. Fortunately you can do this in HKEY_CURRENT_USER so admin rights shouldn't be required. Here are the keys and values you'll want to write:
http://cran.r-project.org/bin/windows/base/rw-FAQ.html#Does-R-use-the-Registry_003f
More detail about how RStudio selects the R version to run here:
https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R
The link to R Portable above is a bit misleading. In order to run a portable version of R AND RStudio, you also need the 27MB portable RStudio here. What's even more confusing is that it has the same name as the RPortable file.
It took me a bit of time to figure that one out. Perhaps you could edit your question to point to both for those who wish for an IDE?
And, IMHO, it's not truly portable, because when you move from one machine to another you need to specify the R version on your USB drive and also the work directory. Pity.
I manage to link RStudio (not portable version) to the aforementioned version of R Portable, directly through Global Options -> R Version -> Choose a specific version of R -> Browse,
and the trick was selecting the R-Portable\App\R-Portable folder. Choosing another one doesnt allow RStudio to find the instalation.
Im running RStudio 1.1.463.
Bye!

how to clone an RStudio environment on a different machine

i've been getting up to speed using R of late, and am wondering what the most efficient way is to clone an RStudio environment, especially the package installations, from one machine to another. i'd like to be able to switch from my desktop machine to my laptop, but i am adding packages very frequently to the desktop as i work and would like a simple way to make sure the same packages get installed on the laptop.
any help much appreciated
ps. not everything i'm installing is from CRAN...some are packages taken from github
If you have more than a couple of machine to maintain with the same R configuration, I think you should consider setting up your own local R repository.
And I will just redirect you to another SO question here:
Creating a local R package repository
You can also find the most useful information in the R manual.
Once this is done, you just have to update the local R repository and the packages will be updated on all machines, Windows or Unix
You can just copy and paste the folders in the R libraries between machines. As long as it is the same operating system on both machines there should not be any problem. If you want it to be automatically synchronised then place the R libraries into something like dropbox so that adding or updating a package will automatically appear on either machine with the next sync.

Installing R packages blocked by security measures [duplicate]

This question already has answers here:
Manually Downloading and Installing Packages in R
(4 answers)
Closed 9 years ago.
At work, I am attempting to use R, but need to install packages. Simple enough, but there is a problem:
The IT policy is that employees cannot access the internet on machines where they have permission to install software, and visa verse. I am working with the IT department to come up with an agreeable solution, but for now I must find another way to do things.
In short, I need to download packages onto one machine where I have internet privileges and then transfer the files to a machine where I have software installation privileges.
You can download the package manually from cran, move it to your computer, then install it.
When you type install.packages() at the prompt without any parameters, it'll give you a popup where you can select the desired package.
Instead, you can go directly to one of the mirror sites. For example:
http://cran.cnr.berkeley.edu/
You just have to save the package(zip, tgz, or tgz.gz depending on your OS) to a folder, open up R from that folder, then call
install.packages("yourPackage.zip")
from the R command prompt.
The problem is that if that package has any dependencies, you'll have to make sure you install them too. You might wind up installing 10 packages, just to be able to use the one you want. It's hard without an internet connection.

Resources