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

Error with unnest_relationships - Error: Can't coerce element 1 from a list to a character #46

Closed
dfgitn4j opened this issue Feb 1, 2019 · 1 comment

Comments

@dfgitn4j
Copy link

dfgitn4j commented Feb 1, 2019

Using the movie graph database I get an error with unnest_relationships. Output followed by clean code below:

Output

`

library(remotes)
remotes::install_github("neo4j-rstats/neo4r")
Skipping install of 'neo4r' from a github remote, the SHA1 (0f2054e) has not changed since last install.
Use 'force = TRUE' to force installation
library(neo4r)
neo4jServerURL <- "http://localhost:7474"
neo4jUser <- "neo4j"
neo4jPassword <- "admin"
con <- neo4j_api$new(url = neo4jServerURL, user = neo4jUser, password = neo4jPassword)
res <- "MATCH (tom:Person {name: 'Tom Hanks'})-[r:ACTED_IN]->(tomHanksMovies) RETURN *;" %>% call_neo4j(con, type = "graph")
node_data <<- as.data.frame(unnest_nodes(res$nodes))
edge_data <<- as.data.frame(unnest_relationships(res$relationships))
Error: Can't coerce element 1 from a list to a character
`

Clean Code

library(remotes)
remotes::install_github("neo4j-rstats/neo4r")
library(neo4r)
neo4jServerURL <- "http://localhost:7474"
neo4jUser <- "neo4j"
neo4jPassword <- "admin"
con <- neo4j_api$new(url = neo4jServerURL, user = neo4jUser, password = neo4jPassword)
res<-"MATCH (tom:Person {name: 'Tom Hanks'})-[r:ACTED_IN]->(tomHanksMovies) RETURN *;" %>% call_neo4j(con, type = 'graph')
node_data<<-as.data.frame(unnest_nodes(res$nodes))
edge_data<<-as.data.frame(unnest_relationships(res$relationships))

@ColinFay
Copy link
Contributor

related to #43, closed by commit #d14b45db

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

2 participants