how can I find the base R installation on ubuntu? - r

I installed both the Microsoft R Open and base R (CRAN) on my linux desktop. But I can't find where my base R was installed now. Is there a way I can find this out?
When I type R in terminal I get the following because /usr/bin/R points to my MRO install.
Microsoft R Open 3.2.3
Default CRAN mirror snapshot taken on 2016-01-01
The enhanced R distribution from Microsoft
Visit http://go.microsoft.com/fwlink/?LinkID=722555 for information
about additional features.
Multithreaded BLAS/LAPACK libraries detected. Using 4 cores for math algorithms.
[Previously saved workspace restored]
> R.home()
[1] "/usr/lib64/MRO-3.2.3/R-3.2.3/lib/R"
I just want to know how I can access my CRAN R install again.
Thanks!

Related

Use SpotfireData package with non-TERR R engine

I want to read in Spotfire Binary data into a non-TERR R engine that can handle graphing and other complex packages, etc. So I want to use the SpotfireData package with other non-TERR R engines. Yet when I try to install, I get an error:
install.packages("SpotfireData")
Warning in install.packages :
package ‘SpotfireData’ is not available (for R version 3.4.4)
Has anyone had luck using the SpotfireData package outside of TERR?
I'm using:
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 4.4
year 2018
month 03
day 15
svn rev 74408
language R
version.string R version 3.4.4 (2018-03-15)
nickname Someone to Lean On
Also, when I switch engines to R3.4.3, I get the same error:
install.packages("SpotfireData")
Warning in install.packages :
package ‘SpotfireData’ is not available (for R version 3.4.3)
Also, when I copy/paste the actual SpotfireData package folder into my R3.4.4 library, I get this error:
library(SpotfireData)
Error in library(SpotfireData) :
‘SpotfireData’ is not a valid installed package
An alternative method is to write a simple data function that Spotfire calls using TERR to save the data from Spotfire into R format and then read that file into R.
Lots more info here: https://community.tibco.com/wiki/tips-debugging-tibco-enterprise-runtime-r-scripts-tibco-spotfire-dataexpression-functions
Here's the important part from that page:
To do this, add a line of code to the top of the R script to save the input parameters to an RData file:
save(list=ls(), file="C:/debug.RData", RFormat=TRUE)
Then, in RStudio or the TERR console, load the RData file and run the R script so that the exact same inputs are used as when the R script ran in the TERR data function.
load(file="C:/debug.RData")
I'm not aware of an easy way to do this - TIBCO don't publish the packages to a repository that I know of.
If you have Spotfire Statistics Services you can find the binary packages under the installation directory - in the 'update\R\src\contrib' folder. Copy the SpotfireData_<ver>.tar.gz file to your machine and then install directly from that file. I've personally used this approach.
To install the library from the file use the 'install.packages' command with the filename, similar to below:
install.packages("c:/users/xxxxxx/Downloads/SpotfireData_9.12.0-63.tar.gz",repos=NULL)
You will also need to have the Rtools installed so it can compile the package from source - check on cran.r-project.org and download the appropriate Rtools for your version.

RStudio not loading RevoScaleR on Ubuntu 16.04

Long story short:
Calling rxImport() works fine in a Terminal R session but fails when using RStudio, despite using the same installation of R.
Setup:
I'd like to use RevoScaleR functions like rxImport(...) on Ubuntu. I have an installation of RStudio and R done through package manager.
I've installed MS Rclient following the instructions here.
Everything seems to work as I can run in the terminal:
/opt/microsoft/rclient/3.4.3/bin/R$ ./R
R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...
Microsoft R Open 3.4.3
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2018 Microsoft
Loading Microsoft R Client packages, version 3.4.3.0097.
Microsoft R Client limits some functions to available memory.
See: https://go.microsoft.com/fwlink/?linkid=799476 for information
about additional features.
...
Using the Intel MKL for parallel mathematical computing (using 2 cores).
Default CRAN mirror snapshot taken on 2018-01-01.
See: https://mran.microsoft.com/.
> R.home()
[1] "/opt/microsoft/rclient/3.4.3/runtime/R"
> rxImport()
Error in rxImport() : 'inData' must be specified.
So the function is loaded and available by default. Now I tell the RStudio to use this installation of R by adding the following at the end of ~/.profile :
RSTUDIO_WHICH_R="/opt/microsoft/rclient/3.4.3/bin/R/R"
Error:
When I run rstudio I get a R console in the IDE saying:
> R.home()
[1] "/opt/microsoft/rclient/3.4.3/runtime/R"
> rxImport()
Error in rxImport() : could not find function "rxImport"
Possible causes
I've found some threads with people complaining about MS packages not dealing properly with ~ and working directory (i.e. on a remote server), setwd() doesn't solve my issue, though.
Do you have any ideas on how to get RevoScaleR to work with RStudio? Thanks in advance.
An answer I got from Github:
https://github.com/rstudio/rstudio/issues/2455#issuecomment-375327109
try setting
R_LIBS_SITE=/opt/microsoft/rclient/3.4.3/libraries/RServer
in
/opt/microsoft/rclient/3.4.3/runtime/R/etc/Renviron

Dual R installation: 3.0.2 and 2.15.2 alongside

As some packages require newer versions of the R statistical framework and others are not updated anymore, there is now no way around having to install two versions of R on the university cluster.
The cluster is running Red Hat Linux and obviously we do not have super users privileges. My goal is to get 3.0.2 and 2.15.2 installed alongside in my home directory.
I have compiled both separately using different .\configure PREFIX= arguments to and that has worked well. But my bash profile still contains this line that will be read by both installations similarly:
export R_LIBS="/home/xapple/share/r_libs/"
This in turn leads to version clashes in the libraries:
< Failed with error: 'package 'MASS' was built before R 3.0.0: please re-install it'
Any elegant solution to having two libraries directories ? Thanks in advance !

R: can rpm files be used with Windows for possibly outdated R packages?

I was trying to run code that required the R packages ‘pkgDepTools’ and ‘Rgraphviz’. I received error messages saying that neither package is available for R version 2.15.0.
A Google search turned up the following webpage RPM Pbone that seems to have the packages:
http://rpm.pbone.net/index.php3/stat/4/idpl/17802118/dir/mandrake_other/com/R-pkgDepTools-1.20.0-1-mdv2012.0.i586.rpm.html
and
http://rpm.pbone.net/index.php3/stat/4/idpl/17802080/dir/mandrake_other/com/R-Rgraphviz-1.32.0-2-mdv2012.0.i586.rpm.html
However, the files have an *.rpm extension rather than the *.tar.gz or *.zip extensions I am used to.
I am using Windows 7 and R version 2.15.0. Can I install an R package from an *.rpm file?
From Wikipedia *.rpm seems like maybe it is more for Linux:
http://en.wikipedia.org/wiki/RPM_Package_Manager
Regarding other possible solutions, I have found several earlier posts here with similar questions about installing R packages that are not available for the most recent version of R:
Bivariate Poisson Regression in R?
Package ‘GeneR’ is not available
R Venn Diagram package Venerable unavailable - alternative package?
I have installed the latest version of Rtools and the package 'devtools'. Although I know nothing about them.
There is an archived version of 'Rgraphviz' here:
http://cran.r-project.org/src/contrib/Archive/Rgraphviz/
but I cannot locate an archived version of 'pkgDepTools'.
If I can install the packages on a Windows machine using the above *.rpm files could someone please provide instructions?
If I must use Rtools to build them I might ask more questions because the instructions at the link below are challenging for me:
http://cran.r-project.org/doc/manuals/R-admin.html#Building-from-source
To be completely transparent I am hoping someone might build them for me, if that is possible. Although I recognize the experience and knowledge gained from doing it myself would probably pay off in the long run.
Thank you for any advice.
pkgDepTools and Rgraphviz are BioConductor R packages not ones hosted on CRAN. Unless you configure your R to download packages from those repos, R will report that they are not available; it can only install from repos it has been configured to install from.
To install those BioConductor packages a lite installation method is provided:
source("http://bioconductor.org/biocLite.R")
biocLite(c("pkgDepTools", "Rgraphviz"))
Further details are provided on the Install page of the BioConductor website
In general you can't use rpm packages on Windows; rpm's are the equivalent of a binary package for Linux. Any C/C++/Fortran/etc code will have been compiled for Linux not Windows. If a package really isn't available for your version of R then check if there is a reason stated on CRAN (usually Windows binaries take a few days longer to produce or there may be requirements for software not available on the CRAN Windows build machines). You can try the WinBuilder service run by Uwe Ligges to build Windows Binaries of packages for you, but if the package was on CRAN and now isn't that suggests it no longer works with current R and can not be built.
In general try a wider search for packages; the first hit in my Google search results under the search string "pkgDepTools" is the Bioconductor page for the package which includes a link to the Windows binary and instructions on how to install the package from within R.
I think this merits an answer rather than a comment.
A gentleman at Bioconductor helped me get Rgraphviz installed. The primary problem was that the version of Rgraphviz I had downloaded only seems to work with the 32-bit version of R and I was running a 64-bit version of R. I was able to install Rgraphviz in the 32-bit version of R.
I had also made an error or two in the PATH statement during some of my attempts to install Rgraphviz. However, the post above in my second comment provides the instructions for installation.
You just, it seems, cannot install the normal download version of Rgraphviz in the 64-bit version of R.
I think many of our emails back and forth are now posted on the Bioconductor forum.
I might edit this answer with more detailed instructions in the next 24-hours.

Why does adding a Depends argument to a package DESCRIPTION cause it not to be compiled for versions after the specified one?

I've just released a package to CRAN which has the following line in the DESCRIPTION file:
Depends: R (>= 2.12.0)
I have never used such a line in a package DESCRIPTION file before, and never had any troubles.
I received the following message a few hours ago, as is typical for CRAN releases:
Dear package maintainer,
this notification has been generated automatically.
Your package maRketSim_0.9.tar.gz has been built for Windows and
will be published within 24 hours in the corresponding CRAN directory
(CRAN/bin/windows/contrib/2.13/).
R version 2.13.1 Patched (2011-07-20 r56455)
All the best,
Uwe Ligges
(Maintainer of binary packages for Windows)
Now with this package, install.packages(maRketSim) on Windows in R 2.13.1 returns:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘maRketSim’ is not available (for R version 2.13.1)
The same error occurs in R 2.13.0 on Windows.
Yet the install works just fine in R 2.12.2 on the same machine.
Did including the Depends line mess things up?
It works for me on Linux. CRAN says that there are currently no binary builds for Windows or MacOS X. What system/OS were you trying the install on when it failed.
Uwe's (automated) message does mention that it might take up to 24 hours for the new build to reach CRAN and thence out to whatever mirror you are using.
And this does appear to be the issue: there is a binary for maRketSim in http://cran.r-project.org/bin/windows/contrib/2.12/ but not yet in http://cran.r-project.org/bin/windows/contrib/2.13/
You just need to wait a little while before you can install the binary for the 2.13.x branch of R/

Resources