r语言 - 无法使用 dplyr 访问现有的 MonetDB



我昨天创建了一个monetdblite数据库,填充了它,并使用dplyr访问它,但是今天早上我似乎无法使用dplyr

这是我的连接:

statcast_db <- MonetDBLite::src_monetdblite("/Users/williampetti/statcast_database/statcast_db_Monet", create = FALSE)

这是statcast_17表的简单查询:

statcast_db %>% 
    tbl("statcast_17") %>% 
    select(game_date) %>% 
    distinct() %>% 
    collect() %>% 
    tail(n = 1)

昨天,这很好。今天早上,我得到了这个错误:

Error in UseMethod("db_query_fields") : 
  no applicable method for 'db_query_fields' applied to an object of class "MonetDBEmbeddedConnection"

如果我使用一个简单的dbGetQuery调用,则可以正常工作:

> dbGetQuery(statcast_db$con, "SELECT game_date FROM statcast_17 ORDER BY game_date DESC LIMIT 1")
   game_date
1 2017-04-29

这是我的会话信息:

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)
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] xml2_1.1.1        baseballr_0.3.1   RSQLite_1.0.0     pacman_0.4.1     
 [5] dplyr_0.5.0       purrr_0.2.2       readr_1.0.0       tidyr_0.6.0      
 [9] tibble_1.2        ggplot2_2.2.1     tidyverse_1.0.0   magrittr_1.5     
[13] MonetDBLite_0.3.1 RMySQL_0.10.9     DBI_0.5-1        
loaded via a namespace (and not attached):
 [1] splines_3.3.1       lattice_0.20-33     colorspace_1.2-6   
 [4] htmltools_0.3.5     mgcv_1.8-12         chron_2.3-47       
 [7] XML_3.98-1.6        survival_2.40-1     hexbin_1.27.1      
[10] foreign_0.8-66      RColorBrewer_1.1-2  plyr_1.8.4         
[13] stringr_1.2.0       munsell_0.4.3       gtable_0.2.0       
[16] rvest_0.3.2         XML2R_0.0.6         codetools_0.2-14   
[19] latticeExtra_0.6-28 knitr_1.14          reldist_1.6-6      
[22] htmlTable_1.7       Rcpp_0.12.9         acepack_1.4.1      
[25] scales_0.4.1        pitchRx_1.8.2       Hmisc_4.0-0        
[28] gridExtra_2.2.1     digest_0.6.11       stringi_1.1.3      
[31] grid_3.3.1          tools_3.3.1         bitops_1.0-6       
[34] lazyeval_0.2.0      RCurl_1.95-4.8      Formula_1.2-1      
[37] cluster_2.0.4       MASS_7.3-45         Matrix_1.2-6       
[40] data.table_1.9.6    lubridate_1.6.0     httr_1.2.1         
[43] assertthat_0.1      R6_2.1.3            rpart_4.1-10       
[46] nnet_7.3-12         nlme_3.1-128   

我在弄清楚加载MonetDBLite的顺序很重要之后,今天早上回答了一个类似的问题。我遇到了这个问题,试图弄清楚它为什么很重要。我的Error in UseMethod问题与Billpetti相同。确保在dplyrdbplyr之后加载MonetDBLite已为我解决问题。这是其他答案的链接:

https://stackoverflow.com/a/53307673/3705612

相关内容

  • 没有找到相关文章

最新更新