Fail to importing R libraries to Julia 1.4 using RCall - r

Imported R libraries to julia using RCall (#rlibrary) cause "Segmentation Error" during run them (not at start the application). I am using latest version of both R (3.6.3) and Julia (1.4.1). Is there any solution?
Problem persists for any library, even R base.

Related

R not loading packages on some MAC versions

I am using the regular R console on a MAC Air with Monterrey as the OS and I'm still having issues loading packages. It is iffy, as to whether a package is loaded and ready to use. Sometimes packages will load and sometimes not. Also, it would not call up data sets that as a default are included in the R packages I'm trying to use. the weird thing is it would recognize the example dataset that is included because when I first tied to call them up, it would let me autocomplete the name. Then it stopped doing that. Then it started telling me that the file doesn't exist. I know I haven't used R in a while but this just seems buggy! any help would be appreciated.
The R version that I have installed is : R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics" and it was installed just last week.
It seems R was not properly installed on your machine.
Several persons reported that using the package manager in RStudio actually did the trick of updating the packages.

first steps of R visual in Power BI

I'm just starting to use R visuals in Power BI, but I can't get it working
Whatever code I try I get this error:
error: could not find function "dir.exists"
Sample code:
As I don't use dir.exists, it seems somehow R can't even be started, however it seems it's set up properly:
RStudio is installed on my pc and it's running properly
I've just downloaded sample .pbix from Microsoft (https://learn.microsoft.com/en-us/power-bi/visuals/service-r-visuals) and it has the exact same error.
dir.exists was introduced in R 3.2 https://cran.r-project.org/bin/windows/base/old/3.2.0/NEWS.R-3.2.0.html
New function dir.exists() in package base to test efficiently whether one or more paths exist and are directories.
Consider upgrading to a more recent version of R.
I would recommend either current R from CRAN (4.0 at the time of this writing), or Microsoft R 3.4.4 to match the runtime in PowerBI Service https://learn.microsoft.com/en-us/power-bi/connect-data/service-r-packages-support
Current R runtime: Microsoft R 3.4.4
R from CRAN can be found at https://cran.r-project.org/ .
Microsoft R 3.4.4 can be found at https://cran.microsoft.com/bin/windows/base/old/3.4.4/
(edit 2021-02: now I'm in doubt, this seems to be R from CRAN as well. See https://mran.microsoft.com/release-history for previous versions of Microsoft R)

Can renv be used to create a virtual environment with a specific version of R?

I recently installed R 4.0, after previously using relying R 3.6.3. To manage R repositories, I use Rstudio (currently 1.2.5042 on a Windows 10 machine). After upgrading to R 4.0, I opened a project from a few months ago, and realized that Rstudio is now, by default, using the newer version of R (and it's library folder). When running renv::restore(), renv attempts to re-install all libraries in the .lock file for the newer version of R, and I don't see any way to specify that I want to keep using R 3.6.3 and it's associated library.
Coming from a python background, I had assumed that renv would create a virtual environment that isolates both the interpreter and the libraries that the project uses (similar to how anaconda environments are created). However, after looking through the documentation and doing a few searches, I have found no reference to isolating a particular version of R. I have, however, found that Rstudio defaults to using the latest version of R, which is not necessarily the behaviour that I want.
I have tried using anaconda to manage an R environment. However, Anaconda relies on its own smaller repository of R packages, and many of the libraries I need are from researchers that house their code on GitHub.
Is there a way to create an R environment in which I can isolate both the R libraries and the version of R itself? Or, perhaps there is something I am missing about how environments with R/Rstudio are intended to be used?
You are correct that renv only manages the installed R packages, and not the R interpreter itself.
Depending on how you're using RStudio, you can still "fake" this by setting the RSTUDIO_WHICH_R environment variable. For example:
export RSTUDIO_WHICH_R=/path/to/R
rstudio
would tell RStudio to "bind" to the version of R specified by the RSTUDIO_WHICH_R environment variable.
For what it's worth, the ability to bind projects to a specific version of R is a feature of the professional editions of RStudio; however, it's not available in the open-source version. See here for more details.

Incompatible packages with MRO on anaconda

I have some complicated code in R that uses the neuralnet library for some computations.
Sorrily, I'm new to R and I'have less than a week to obtain some results using the existing code, which take quite a while in the processors I have to my disposal.
My idea is to implement the code via microsoft R open (MRO), which could accelerate the computations, but I haven't been able to install the neuralnet library via anaconda (I prefer anaconda because it's simple and allows to create environments easily). The installation goes with "Solving environment" forever.
Is there a way to install these libraries to be compatible with MRO on anaconda?? should i desist of using anaconda for this task?

Using R package RJulia

I would like to install the R Package JuliaCall, to use Julia from R. I have installed Julia via snap and installed the JuliaCall R package form the Cran.
I received the following error when trying to use the setup function of JuliaCall.
library(JuliaCall)
julia <- julia_setup()
Julia version 1.0.4 at location /snap/julia/13/bin will be used.
Error in dyn.load(.julia$dll_file) :
unable to load shared object '/snap/julia/13/bin/../lib/libjulia.so.1':
/snap/julia/13/bin/../lib/libjulia.so.1: wrong ELF class: ELFCLASS32
Show Traceback
Rerun with Debug
Error in juliacall_initialize(.julia$dll_file) :
/snap/julia/13/bin/../lib/libjulia.so.1 - /snap/julia/13/bin/../lib/libjulia.so.1: wrong ELF class: ELFCLASS32
Julia is installed:
XRJulia::findJulia()
[1] "/snap/bin/julia"
I have tried some suggestions found in
https://github.com/Non-Contradiction/JuliaCall/issues/72
and even report my problems, but I'm not sure if this is an issue to open on Github or a problem with my installation.
The same error occurs
My system specifications are:
Ubuntu 18.04,
Rstudio 1.1.456,
R 3.5.1,
Julia installed via snap
Thanks for any help you could provide
Actually, the developer of JuliaCall answered my question.
I have installed Julia using snap without noticing that a 32bits version was used. Installing Julia from the .tar.gz archive and choosing the correct 64 bits version solve this problem.
Many Thanks to #Non-Contradiction.

Resources