FenTechSolutions / CausalDiscoveryToolbox

Package for causal inference in graphs and in the pairwise settings. Tools for graph structure recovery and dependencies are included.
https://fentechsolutions.github.io/CausalDiscoveryToolbox/html/index.html
MIT License
1.08k stars 198 forks source link

some R package is not available or R Python Error Output #114

Closed SongNY closed 2 years ago

SongNY commented 2 years ago

I run code on my own anaconda env ImportError: X R package is not available. Please check your installation. There is a solution delete ./cdt/utils/R.py "--vanilla", which means 192 / 202 / 204 lines output = subprocess.call([str(rpath), "--vanilla", str(scriptpath)], to output = subprocess.call([str(rpath), str(scriptpath)], and what does "--vanilla" mean???

diviyank commented 2 years ago

Hello,

The issue comes from your R package installation ; the vanilla option is just to avoid saving the R session

from the man page (https://colinfay.me/intro-to-r/appendix-b-invoking-r.html) :

 –vanilla

    Combine –no-save, –no-environ, –no-site-file, –no-init-file and –no-restore. Under Windows, this also includes –no-Rconsole.

Best, Diviyan

SongNY commented 2 years ago

Hello,

The issue comes from your R package installation ; the vanilla option is just to avoid saving the R session

from the man page (https://colinfay.me/intro-to-r/appendix-b-invoking-r.html) :

 –vanilla

    Combine –no-save, –no-environ, –no-site-file, –no-init-file and –no-restore. Under Windows, this also includes –no-Rconsole.

Best, Diviyan

Hello,

When I run Rscript –-vanilla a.R cause error

Error in library(CAM) : there is no package called ‘CAM’
Execution halted

which a.R include library(CAM)

But I run Rscript a.R success but it really cause my log long

my r version is 3.6.1

maybe old r version have some error in vanilla

I hope my debug will help other people

Best, Sunnyu

diviyank commented 2 years ago

Hello, I think your Rscript path and your R installation have different paths. you can specify the newest version by specifying manually your path using cdt.SETTINGS.rpath="/pathtoyourinstallation/Rscript"