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
Related
I have installed Microsoft R Client. When I run R from shell, I get
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.
Type 'readme()' for release notes, privacy() for privacy policy, or
'RevoLicense()' for licensing information.
Using the Intel MKL for parallel mathematical computing (using 36 cores).
Default CRAN mirror snapshot taken on 2018-01-01.
See: https://mran.microsoft.com/.
However, when I run R from Rstudio-server, I get only
Microsoft R Open 3.4.3
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2017 Microsoft Corporation
Using the Intel MKL for parallel mathematical computing (using 36 cores).
Default CRAN mirror snapshot taken on 2018-01-01.
See: https://mran.microsoft.com/.
The system only has one copy of R, and it together with the library path are correctly specified in rserver.conf
cat /etc/rstudio/rserver.conf
# Server Configuration File
rsession-which-r=/usr/bin/Revo64
rsession-ld-library-path=/opt/microsoft/rclient/3.4.3/libraries/RServer
Inside the Rstudio R environment, the library path is there
>.libPaths()
[1] "/home/xyz/R/x86_64-pc-linux-gnu-library/3.4"
[2] "/opt/microsoft/rclient/3.4.3/runtime/R/library"
However, RevoScaleR does not load automatically. When I try to load it manually, I get
> library(RevoScaleR)
Fehler in library(RevoScaleR) : es gibt kein Paket namens ‘RevoScaleR’
Anybody has an idea what may be wrong?
An answer from Github:
https://github.com/rstudio/rstudio/issues/2455#issuecomment-375327109
setting
R_LIBS_SITE=/opt/microsoft/rclient/3.4.3/libraries/RServer
in
/opt/microsoft/rclient/3.4.3/runtime/R/etc/Renviron
I recently updated my macbook to macOS Sierra (Version 10.12.3 (16D32)), and I am no longer able to run R directly from Terminal:
DN51ssqi:~ kjytay$ R
-bash: R: command not found
DN51ssqi:~ kjytay$ R --version
-bash: R: command not found
Opening R from the Applications folder or from RStudio works fine. Anyone experience this issue/has been able to fix it?
Here is my R version information:
platform x86_64-apple-darwin13.4.0
arch x86_64
os darwin13.4.0
system x86_64, darwin13.4.0
status
major 3
minor 3.2
year 2016
month 10
day 31
svn rev 71607
language R
version.string R version 3.3.2 (2016-10-31)
nickname Sincere Pumpkin Patch
This is just a guess, but I'm thinking this is probably an issue with your PATH settings, which might have been overwritten when you upgraded*. Seems worth a try at least. This is from the RStudio support pages**:
R from source (including MacPorts and Homebrew)
When R is installed from CRAN on OS X the R executable is installed at
/usr/bin/R. However, if R is installed directly from source or via a
package manager like MacPorts or Homebrew, then the R executable is
installed to either /usr/local/bin/R (Homebrew) or /opt/local/bin/R
(MacPorts). In order to support these variations, RStudio scans for
the R executable in the following sequence:
/usr/bin/R
/usr/local/bin/R
/opt/local/bin/R
If RStudio is not able to locate R by scanning these locations, it
will fall back to using whatever version of R is located at
/Library/Frameworks/R.framework/.
If RStudio is finding R OK, then you must have it at one of these locations. Make sure these locations are in your $PATH list:
In the Terminal:
echo $PATH
Will display your current PATHs list. If any of the locations in the RStudio quote are missing, you can see if that's where R is located by trying to specify that location. For example:
/usr/local/bin/R
If that works to start R, just add that location to your PATHs list:
export PATH=$PATH:/usr/local/bin
So that OSX knows where to find it!
* It's been noted elsewhere that homebrew breaks, for example, on upgrade to Sierra. Here's a blog post outlining some steps an R user might like to take after the upgrade: http://www.statsblogs.com/2017/01/26/upgrading-to-macos-sierra-nee-osx-for-r-users/
** Here's the support page where the quote is from https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-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!
I am running R version 3.1.3 (2015-03-09) with RStudio 0.98.1103 under OS X 10.10.2 (Yosemite). I migrated to this machine recently and moved files and applications (R and profile files included) with OS X Migration assistant.
R has worked perfectly until I tried to install.packages(). The function initiates but it doesn't produce any printout or terminate. I tried different things:
I removed my .Rprofile file which indicates my package folder and restart R;
I tried different mirrors with install.packages('RMySQL', repos='http://cran.us.r-project.org');
I tried install.packages() both from shell and from R GUI;
I tried to upgrade all packages with RStudio.
I never encountered an error message of sort and none of the above worked or produced any result.
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/