neo4j-rstats / neo4r

A Modern and Flexible Neo4J Driver
https://neo4j-rstats.github.io/user-guide/
Other
106 stars 29 forks source link

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

Closed dfgitn4j closed 5 years ago

dfgitn4j commented 5 years ago

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 (0f2054e5) 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 commented 5 years ago

related to #43, closed by commit #d14b45db