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

[BUG] PC algorithm, R Packages (k)pcalg/RCIT is not available #104

Closed yulaicui closed 3 years ago

yulaicui commented 3 years ago

The flowing image has a code snippet with the error:

image

I installed RCIT, pcalg, kpcalg, MASS, momentchi2, and ran the following code (from readme):

library(devtools) install_github("erictrobl/RCIT") library(RCIT) RCIT(rnorm(1000),rnorm(1000),rnorm(1000)) RCoT(rnorm(1000),rnorm(1000),rnorm(1000)) RCoT(rnorm(1000),rnorm(1000),matrix(rnorm(2000),1000,2)

My R packages are:

image

System: 64bit windows10 GPU: 0 Python: 3.8.8 R: 3.6.3 RTools:3.5

What might be the problem here?

Thanks!

diviyank commented 3 years ago

Hello, It is strange, maybe cdt is looking at the wrong R executable. Could you execute :

import cdt
print(cdt.utils.R.Rpackages)

It might take some time, but it is testing the availability of all packages|

Best, Diviyan

yulaicui commented 3 years ago

Hello, It is strange, maybe cdt is looking at the wrong R executable. Could you execute :

import cdt
print(cdt.utils.R.Rpackages)

It might take some time, but it is testing the availability of all packages|

Best, Diviyan

Hi,

It says "module 'cdt.utils.R' has no attribute 'Rpackages'

diviyank commented 3 years ago

Whoops, small typo, it's a capital P:

import cdt
print(cdt.utils.R.RPackages)
yulaicui commented 3 years ago

problem solved. I didn't install pcalg and kpcalg properly with BiocManager

diviyank commented 3 years ago

Great, I'll close the issue!