Using RCall

#1

Hello,

I’m still trying to solve my PCA problem, so I’m trying to use R over RCall. The package can be installed, but after using RCall, R reports up, but gets stuck! That is, nothing happens more…! The behavior applies to Julia 1.0.3 and Juliapro (Atom):

julia> using RCall
[ Info: Precompiling RCall [6f49c342-dc21-5d91-9882-a32aef131414]

R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

That’s all, nothing’s happening anymore! The system is no longer responding…

I’m using Windows 10…

I am happy about every hint and many greetings,
Günter

#2

Using RCall doesn’t mean you will have a R repl right away. To call R code simply do

b = 100
@rput b
R"""
#R CODE HERE
a = sapply(1:b, function(x) x)
"""
@rget a;
a
```
#3

Thank you for your answer! But that’s not what I mean.

I just can’t type anything anymore because the console or Atom is “frozen”. I wanted to run a similar example for testing, but I didn’t get that far! :thinking:

Do you have any idea what that might be?

#4

What if you just do using RCall in the terminal? I am using Win10 also but I have R 3.5.3 and it works fine.

#5

I had two R instances (3.4.3 and 3.5.2) installed. I uninstalled both and installed R 3.5.3. Now I get identical error messages for the terminal and for Juliapro:

ERROR: InitError: error compiling __init__: error compiling initEmbeddedR: could not load library "C:\PROGRA~1\R\R-34~1.3\bin\x64\R.dll"

Is R 3.4.x preset in a setup file? Can I influence this and if so how? :thinking:

#6

Not an Rcall user, but these types of DLL errors can often be solved by ] build RCall

1 Like
#7

Set your R_HOME environment variable to C:\Program Files\R\R-3.5.2 or equivalent. then ]build RCall

1 Like
#8

Hello both of you, thank you for this hint! It’s on!

First step:
Activate the library setting of R from

# set a site library
# .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library")

to

.Library.site <- file.path(chartr("\\", "/", R.home()), "site-library")

and then built! Then I could call and execute R as described in the documentation!

Thanks again and many greetings,
Günter

1 Like