dplyr包中的“过滤器”导致错误消息

时间:2018-08-17 23:40:35

标签: r dplyr

我对ClickHouse数据库(通过RClickhouse软件包与Rserver连接)运行查询。除非我使用filter函数,否则查询会平稳运行-该函数会生成有关错误对象类型的错误消息

重要信息:仅在公共服务器文件夹中的Rstudio项目中会出现此问题。在与R共享父文件夹(/ users / boris /)的类似项目中,相同的代码可以正常工作(没有错误)

    > a <- con %>% tbl("test_sample") %>% select(domain) %>% collect()
    > show(a)
    # A tibble: 140,000 x 1
       domain                         
     * <chr>                          
     1 allforchildren.ru

    > a <- con %>% tbl("test_sample") %>% filter(domain == "wildberries.ru") %>% collect()
      Error in storage.mode(x) <- "double" : 
         (list) object cannot be coerced to type 'double'  

有人猜测对filter函数做出这种反应的原因是什么?

P.S。会话信息

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.7.0
LAPACK: /usr/lib/lapack/liblapack.so.3.7.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] urltools_1.7.1    dplyr_0.7.6       getPass_0.2-2    
[4] DBI_1.0.0         RClickhouse_0.4.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18     dbplyr_1.2.2     crayon_1.3.4     assertthat_0.2.0
 [5] R6_2.2.2         magrittr_1.5     pillar_1.3.0     rlang_0.2.1     
 [9] rstudioapi_0.7   bindrcpp_0.2.2   tools_3.5.1      glue_1.3.0      
[13] triebeard_0.3.0  purrr_0.2.5      compiler_3.5.1   yaml_2.2.0      
[17] pkgconfig_2.0.1  bindr_0.1.1      tidyselect_0.2.4 tibble_1.4.2

0 个答案:

没有答案