CausalDiscoveryToolbox
CausalDiscoveryToolbox copied to clipboard
R Package (k)pcalg/RCIT is not available. RCIT has to be installed from https://github.com/Diviyan-Kalainathan/RCIT
When I am running this code
` import cdt import pcalg #import kpcalg import networkx as nx from cdt.causality.graph import PC from cdt.data import load_dataset import matplotlib.pyplot as plt data, graph = load_dataset("sachs") cdt.SETTINGS.rpath = 'C:/Program Files/R/R-4.1.0/bin/Rscript' obj = PC() output = obj.predict(data) nx.draw_networkx(output, font_size=8) plt.show()
`
I am getting this error
"R Package (k)pcalg/RCIT is not available. RCIT has to be installed from https://github.com/Diviyan-Kalainathan/RCIT". I have already installed the necessary packages. I need your help on this.
Thanks
PFA
Hello ! I think your CDT package might be linked to another R installation ; could you check if C:/Program Files/R/R-4.1.0/bin/Rscript -e "library('pcalg')
( or something close, just to check the Rscript)
Does actually work properly ?
Best,
Diviyan
Thank you so much for your response. I am very new to R environment. Can you please tell me where to run the above line? I will check and update you.
Hello ! This command has to be ran in the Windows command line
otherwise, just go to the path and execute the R executable and try to execute library('pcalg')
Error: package or namespace load failed for 'pcalg' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called 'graph' In addition: Warning message: package 'pcalg' was built under R version 4.1.3 Execution halted
I am trying to update my R version to 4.1.3.
Hello do you tackle this issue? I am facing the same condition as yours