1

I've got a problem with this code:

library(RNeo4j)
library(dplyr)
library(stringr)
library(MASS)

graph = startGraph("http://localhost:7474/db/data/", username = "neo4j", password = ",yT:/9L)8aoi8t")

query = "MATCH (m:MARKETS)
MATCH (n:CBP_NAICS {msa_naics: m.jll_msa} )
WHERE n.naics CONTAINS '----'
match (c1:Category)
WHERE toString(c1.id) = left(n.naics,2)
match (q:JLL_qtr {qtr: 'Q2-2016',mkt: m.mkt,level: 1} )
match (c:BldgClass {qtr: q.qtr,mkt: m.mkt,class: 'Totals'} )
match (N:Neighborhood {qtr: c.qtr,nbrhd: c.nbrhd,nbrhd: q.nbrhd,BldgClass: c.class} )
return m.mkt, n.msa_naics, ... ,N.AvgOverallAskRent"

naics_jll <- cypher(graph, query)

df_corr <- naics_jll[sapply(naics_jll, is.numeric)]
  1. The Neo4j query itself yields expected results when run in the Neo4j shell.
  2. In RStudio, the data frame appears correct. View(naics_jll) & View(df_corr) both "look right"
  3. However dplyr::summarize() -- for both data frames -- gives: ## data frame with 0 columns and 0 rows
  4. On top of that, I get "funny" results from analysis of the data in the data frames.

I did both a Google search and a SO search on both data frame with 0 columns and 0 rows AND rneo4j data frame with 0 columns and 0 rows, and found nothing helpful.

Steve
  • 575
  • 4
  • 18
  • Your query is missing any returns? perhaps that's why? – Michael Hunger Sep 21 '16 at 23:55
  • Thanks Michael. No, I must have had a copy-paste error. I've edited the code in my original question, and it's the exact R script I'm running. The ... in the return statement is just a long list of variables. it works in the Neo4j shell. – Steve Sep 22 '16 at 00:29

0 Answers0