How to use R CMD INSTALL to install only essential files - r

I am using R CMD INSTALL to install libraries from a folder with .zip binaries to my rlibs directory. When I do this, many folders for each library are installed in the rlibs directory. Take for example the bit package. I have downloaded the bit_1.1-12.zip file from https://cran.r-project.org/web/packages/bit/index.html.
Now I install it by using the following command:
R CMD INSTALL --library=./r_libs ./external/bit_1.1-12.zip
This will create a file structure underneath the folder ./r_libs/bit
Now here is my question: How can I install only the essential library files that R needs to import? I believe this is the ./r_libs/bit/libs/ folder (I might be wrong). Currently there is plenty of additional folders installed, such as html, help, Meta, and more.
I have tried several options that R CMD INSTALL --help gives me. The description in https://stat.ethz.ch/R-manual/R-devel/library/utils/html/INSTALL.html tells me to install just the compiled code for another sub-architecture, use --libs-only. However,
R CMD INSTALL --libs-only --library=./r_libs ./external/bit_1.1-12.zip
gives me an error message that there is no ./r_libs/bit/lib directory. The options --no-html, --no-help seem to not do anything.
I am working on a Windows 7 machine using R add-on package installer 3.0.2.
What am I missing here?
Thank you.

Related

Installation of R on redhat8 offline

I'm trying to have a way to download R for multiple clients with no internet access. Is there a way to download the .tar.gz files for all of R and its dependencies, so you don't need to download with internet connection? If there is a way to do that will R still show up with the "whereis R" command on linux? I'm trying to find a way in which I can give someone the downloaded files already within a package and they just run a .sh script that will download everything and R's dependencies for them with no real user intervention.
You may follow the manual on the topic "installing R under Unix-alike". Briefly: download the source and make it.
Download R and untar it
You can download the source from:
https://cran.r-project.org/sources.html
Then, use "tar" to extract the source and build it. Let's suppose that you want to install R 4.2:
tar -xf R-4.2.0.tar.gz
Make
Go to a directory where you will install R. Note that the path shouldn't contain spaces.
./configure
make
make check
If you want to install all the R tree (binaries, manuals, libraries...) use:
make install
Installing packages from source
To install packages in R, you can use the function install.packages() with the name of the file ('...tar.gz') to be installed and the argument "repos" set as "NULL"
You can also install the packages from a shell:
R CMD INSTALL -l /path/to/library packagename
Check the manual for additional information
You may also be interested in looking at this information:
https://cran.r-project.org/bin/linux/redhat/
https://cran.r-project.org/sources.html
The R manual describes how to install R from source in:
R-admin > Obtaining R > Getting and unpacking the sources
R-admin > Installing R under Unix-alikes

Off-line installation of IRkernel for Jupyter/IPython notebook

I am working on an off-line Ubuntu server and I would like to write an IPython notebook with only R code. I understand that for this to work I need to install the IRkernel. This shouldn't be a problem if the server was on-line, but unfortunately this is not the case. Any suggestions how to install the IRkernel off-line are greatly appreciated.
Oliver
(I have installed Anaconda3-2.2.0-x86-64 and R 3.0.2 on the Ubuntu server)
You can use Cube to download the required Ubuntu packages (I think just zmq3) on an online computer and then install it on your offline server.
You would then need to download the needed R packages (rzmq,repr,IRkernel,IRdisplay - in tar.gz form)
To load those into your server you can use the following commands to install the R packages from source.
R CMD INSTALL package_ x.y.z.tar.gz
If you don't have permission to write to the standard library directory and can't use sudo to override, you can install it somewhere else via
R CMD INSTALL -l <user_lib> package_x.y.z.tar.gz
where <user_lib> is a directory you can write to. You may need to specify lib.loc when subsequently loading the package, if <user_lib> is not in .libPaths)
See this manual for more information; R CMD INSTALL --help may also be useful
It's a less than ideal solution but it should work assuming there aren't any dependancies I've missed.

cygwin aspell installing new language

have a problem with adding new language to cygwin.
As source for language i tried using ubuntu dictionary files.
It would be interesting if anyone could install any non default languages in cygwin spell checker.
The Ubuntu packages use different directories (/usr/lib/aspell vs. /usr/lib/aspell-0.60 on Cygwin), so this isn't going to work. Instead, I suggest you build and install these from the source in one of the following ways:
Download the latest source tarball for your language from http://ftpmirror.gnu.org/aspell/dict/, unpack the tarball, then run ./configure, make, and make install.
Use cygport to build a package for you, then manually install it. For example, create an aspell-lt.cygport file with the following contents:
ASPELL_COMPAT=6
inherit aspell-dict
NAME="aspell-lt"
VERSION=1.2.1.0
RELEASE=1
CATEGORY="Text"
SUMMARY="Aspell Lithuanian dictionaries"
Then run cygport aspell-lt.cygport fetch prep build install package. Such a package would then be fit for contribution to the Cygwin distribution.

R install package globally

How do I install an R package globally, so it's available to all users? Currently I'm doing
R.exe CMD INSTALL *.zip
But it does
* installing to library 'C:/Users/Matt/Documents/R/win-library/2.15'
I would like to install the packages alongside R in Windows' 'program files'.
Your big problem here is installing to C:\Program Files\. This means on versions of windows with file permissions, you need admin permissions to write to that folder. As R does not commonly request admin permissions, it will on default install to an user subdirectory, unless you run R as administrator (by right clicking on the shortcut). In which case you can use the GUI to install packages and it will install them globally by default. For working on the command line, you can also run the cmd session as administrator.
In future, it's recommended that you install R to say, C:\R\ to avoid this.
What worked for me was running:
install.packages("MyPackage", lib="C:\\Program Files\\R\\R-3.0.1\\library")
Installing it to Program Files wasn't a problem for me - the problem was that the default installation directory was in C:\\Users\\Mike\\Documents\\R\\...
Ultimately you just want to install it to wherever .libPaths() looks by default, and in my environment that was most commonly C:\\Program Files\\R\\R-3.0.1\\library
Here is a way to specify where to find or install libraries. You can put the libraries in a common directory.
http://cran.r-project.org/doc/manuals/R-admin.html#Managing-libraries

Installing an R package from the source files

I am trying to install the r package "segue" from the source. Unfortunately, there's no tarball provided at this time, and I don't know how to compile and install a package from the binary files. I'm on a mac, if that helps.
Thanks!
As the author of Segue, I threw you a bone and rolled the tar ball for you :)
What you see on the Google Code page is not the binary files, they are the source files. Now me doing it for you is not that helpful for helping you understand packages. So if you wanted to build this yourself, here's how you would do it:
clone the source tree so you have a local copy on your machine. Make sure you have Mercurial installed and then type hg clone https://segue.googlecode.com/hg/ segue to clone the code to your machine.
build the package, test it, and install with the following three commands:
R CMD build segue/
R CMD check segue_0.02.tar.gz
R CMD INSTALL segue_0.02.tar.gz
I've never actually used a Mac so I think these commands are right. I know they work on Linux. So let me know if I need to alter these instructions for Mac. You're helping me write documentation!

Resources