Installing R packages blocked by security measures [duplicate] - r

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.

Related

How to use R in HPC SSH frontend?

I used to use R in RStudio which make it easer to handle.
As I got a bigger data I got access to a HPC of the university through SSH interface (MobaXterm) which could be done using terminal as well.
My problem is my inability to access to the administration, which prevent me from installing packages. And I'm pretty sure that I need to change one of the libraries directory that I don't have access to it.
.libPaths()
[1] "/home/UserIsMe/R/x86_64-pc-linux-gnu-library/4.2"
[2] "/cm/shared/apps/R/4.2.1/lib64/R/library"
Is there any way to change the second directory to mine (like the first).
NB: I found a trouble even when I'm trying to install packages from linux's terminal.

do I need to re-install tidyverse all the time?

I am new to R and just wondering if for every dataset I need to work on, I need to re-install tidyverse? I noticed that on the google Data Analytic program, we are always asked to install. Package("tidyverse")
No, you only have to install it once. The program suggests installing it every time to make sure you get it if you don't already have it.
After the first time you install it, it becomes part of your package library, so it is available for scripts to use as long as the package library remains accessible. You can read more about packages and libraries here:
https://hbctraining.github.io/Intro-to-R-flipped/lessons/04_introR_packages.html

Running R and RStudio on Dropbox [duplicate]

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.

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.

Automatic network Installation

Recently I have been attempting to install a software package automatically over a moderately sized computer network for a university lab. The package is aspenOne v8.4. I have tried creating response files, but every time I finish the install I am unable to locate the response file. I included the f1 flag option to specify file location and name, and I have also checked the %systemroot% directory as well, to no avail. I do not believe one is being created. I have also tried creating a response file for the msi package included on the disc with msiexec, but I was unsuccessful in that path as well. The install requires too much time to install manually across the network, so I was hoping there might be another option to automatically deploy the application package throughout the network. Is there a way to do this?
Thank you in advance.

Resources