I'm trying to access my Neo4j data directly from R to do some network analysis
I have already read this: Use neo4j with R
So I tried using their code:
#install.packages('RCurl')
#install.packages('RJSONIO')
library('bitops')
library('RCurl')
library('RJSONIO')
query <- function(querystring) {
h = basicTextGatherer()
curlPerform(url="myhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query",
postfields=paste('query',curlEscape(querystring), sep='='),
writefunction = h$update,
verbose = FALSE
)
result <- fromJSON(h$value())
#print(result)
data <- data.frame(t(sapply(result$data, unlist)))
print(data)
names(data) <- result$columns
}
q <-"start a = node(50) match a-->b RETURN b"
data <- query(q)
print(data)
However all I get is:
data frame with 0 columns and 1 rows + print(data) NULL
am I doing something wrong?