nySTAT / OrdCD

Ordinal Causal Discovery
Other
0 stars 2 forks source link

there is no package called ‘graph’ #1

Closed Abu-thahir closed 1 year ago

Abu-thahir commented 1 year ago

Hii ,

When i am trying to run the package using the simulation you have provided ,

set.seed(2020) n=1000 #sample size q=5 #number of nodes y = u = matrix(0,n,q) u[,1] = 4rnorm(n) y[,1] = (u[,1]>1) + (u[,1]>2) for (j in 2:q){ u[,j] = 2y[,j-1] + rnorm(n) y[,j]=(u[,j]>1) + (u[,j]>2) } A=matrix(0,q,q) #true DAG adjacency matrix A[2,1]=A[3,2]=A[4,3]=A[5,4]=1 y=as.data.frame(y) for (j in 1:q){ y[,j]=as.factor(y[,j]) }

G=OCD(y) #estimated DAG adjacency matrix print(A) print(G)

throws me an error ,

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘graph’

and even after loading the package , the OCD function is not getting invoked !

can you help me where i went wrong and can you provide any other working code snippet ?

nySTAT commented 1 year ago

It looks like you don’t have library “graph”. Have you successfully installed that library from bioconductor?YangSent from my iPhoneOn Jan 1, 2023, at 16:47, Abu-thahir @.***> wrote: Hii , When i am trying to run the package using the simulation you have provided , set.seed(2020) n=1000 #sample size q=5 #number of nodes y = u = matrix(0,n,q) u[,1] = 4rnorm(n) y[,1] = (u[,1]>1) + (u[,1]>2) for (j in 2:q){ u[,j] = 2y[,j-1] + rnorm(n) y[,j]=(u[,j]>1) + (u[,j]>2) } A=matrix(0,q,q) #true DAG adjacency matrix A[2,1]=A[3,2]=A[4,3]=A[5,4]=1 y=as.data.frame(y) for (j in 1:q){ y[,j]=as.factor(y[,j]) } G=OCD(y) #estimated DAG adjacency matrix print(A) print(G) throws me an error , Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘graph’ and even after loading the package , the OCD function is not getting invoked ! can you help me where i went wrong and can you provide any other working code snippet ?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>