neo4j-rstats / neo4r

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

attempt to apply non function #16

Closed Btibert3 closed 6 years ago

Btibert3 commented 6 years ago

I wanted to play around with these projects and started with the README. However, I can't ping the server, see below:

options(stringsAsFactors = FALSE)

## load libraries
install.packages("remotes")
remotes::install_github("neo4j-rstats/neo4r")
library(neo4r)
remotes::install_github("neo4j-rstats/play4j")
library(play4j)

## connect to neo4 3.3.0 from neo4j desktop
URL = "/Users/btibert/Library/Application Support/Neo4j Desktop/Application/neo4jDatabases/database-d2412486-df0a-43fb-8ec8-c578391fcaee/installation-3.3.0"
con <- neo4j_api$new(url = "http://localhost:7474",  user = "neo4j", password = "password")
con$ping()

results in the error

> con$ping()
Error: attempt to apply non-function

my session info

> sessionInfo()
R version 3.4.4 RC (2018-03-08 r74373)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bindrcpp_0.2.2      tidyjson_0.2.1.9000 play4j_0.0.0.9000   neo4r_0.0.0.9000    tibble_1.4.2        purrr_0.2.4        
[7] tidyr_0.8.0         dplyr_0.7.4         jsonlite_1.5       

loaded via a namespace (and not attached):
 [1] igraph_1.2.1     Rcpp_0.12.16     knitr_1.20       bindr_0.1.1      magrittr_1.5     tidyselect_0.2.4 R6_2.2.2        
 [8] rlang_0.2.0      stringr_1.3.0    httr_1.3.1       tools_3.4.4      remotes_1.1.1    htmltools_0.3.6  rprojroot_1.2   
[15] digest_0.6.15    yaml_2.1.18      assertthat_0.2.0 attempt_0.2.0    base64enc_0.1-3  curl_3.2         evaluate_0.10.1 
[22] glue_1.2.0       rmarkdown_1.6    stringi_1.1.7    compiler_3.4.4   pillar_1.2.1     backports_1.1.1  pkgconfig_2.0.1 
ColinFay commented 6 years ago

hi @Btibert3, thanks for sharing!

{play4j} also has a neo4j_api function, so this error may come from the fact that {play4j} is loaded after {neo4r}, so here you're trying to call play4j::neo4j_api.

In the end they will both be the same R6 Class, but for now play4j::neo4j_api has no ping() method.

Can you try again but without loading {play4j} ?

Thanks again, Colin

Btibert3 commented 6 years ago

That worked, closing for now. I didn't get it to work but I am 99% confident that was on my end.