Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert a Neo4j connection object into a DAGitty object #41

Open
ghost opened this issue Sep 20, 2020 · 3 comments
Open

convert a Neo4j connection object into a DAGitty object #41

ghost opened this issue Sep 20, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 20, 2020

I am having problem to convert a neo4j connection object into a dagitty object.

using as.dagitty(con)

where con is a connection object using neo4r package.

Returned result is:
Error in as.vector(x, "character") :
cannot coerce type 'environment' to vector of type 'character'
In addition: Warning message:
In if (class(x) == "dagitty") { :
the condition has length > 1 and only the first element will be used

Would anyone enlighten me in this regard?

@jtextor
Copy link
Owner

jtextor commented Sep 21, 2020

There would need to specific code to convert a neo4j graph to DAGitty. If you send me a complete example of what you are trying to accomplish, perhaps I can write one

@ghost
Copy link
Author

ghost commented Sep 21, 2020

Thanks for willing to help. Appreciated! This is the code and what I am trying to do:

#Connect ne4j database with R
library(neo4r)
con <- neo4j_api$new( url = "http://localhost:7474" , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE )
contest <- con$ping()
contest

#path analysis using dagitty
library(dagitty)
as.dagitty(con) # not working. I was thinking if I could convert the neo4r connection object as a dag graph, then I could using dagitty to analyze that graph
g1<-getExample("Shrier")
paths(backDoorGraph(g1)) # here I am using the dagitty example to test, but I want to put a neo4j graph here.

Please ignore the following if you have no problem with connection neo4j with r.
library(devtools)
install_github("davidlrosenblum/[email protected]”)
library(neo4r)
packageVersion('neo4r') # this should be ‘4.0.0’
con <- neo4j_api$new( url = "http://localhost:7474",db = 'neo4j', user = "neo4j",password = “what your password is”, isV4 = TRUE )
#Make sure the Neo4j database version is 4.0.8 or above

@ghost
Copy link
Author

ghost commented Sep 25, 2020

There would need to specific code to convert a neo4j graph to DAGitty. If you send me a complete example of what you are trying to accomplish, perhaps I can write one

Hi there,

I do not mean to push, but just wondering if there is any progress? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant