dplyr :: count()无法在MacOS上运行

时间:2017-12-08 16:37:57

标签: r dplyr

我试图从dplyr包中运行一个简单的命令,但我无法让我的生活变得有效。这是我在dplyr::count()的文档中执行其中一个示例时得到的结果:

dplyr::count(mtcars, cyl)
#> Error in quo_is_missing(wt) || quo_is_null(wt) : 
#>   invalid 'y' type in 'x || y'

这是我的会话信息:

sessionInfo()
#> R version 3.4.2 (2017-09-28)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Sierra 10.12.5

#> 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     

#> loaded via a namespace (and not attached):
#> [1] compiler_3.4.2 tools_3.4.2    yaml_2.1.15

这些是加载dplyr后的会话信息和冲突:

sessionInfo()
#> R version 3.4.2 (2017-09-28)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Sierra 10.12.5

#> 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] dplyr_0.7.4.9000

#> loaded via a namespace (and not attached):
#>  [1] tidyselect_0.2.3 compiler_3.4.2   magrittr_1.5     assertthat_0.2.0 R6_2.2.2        
#>  [6] tools_3.4.2      bindrcpp_0.2     glue_1.2.0.9000  tibble_1.3.4     yaml_2.1.15     
#> [11] Rcpp_0.12.14     knitr_1.17       pkgconfig_2.0.1  rlang_0.1.4.9000 purrr_0.2.4.9000
#> [16] bindr_0.1       

conflicts(detail=TRUE)
#> $`package:dplyr`
#> [1] "filter"    "lag"       "intersect" "setdiff"   "setequal"  "union"    

#> $`package:stats`
#> [1] "filter" "lag"   

#> $`package:methods`
#> [1] "body<-"    "kronecker"

#> $`package:base`
#> [1] "body<-"    "intersect" "kronecker" "setdiff"   "setequal"  "union" 

1 个答案:

答案 0 :(得分:1)

我安装了purrr的开发版本(purrr_0.2.4.9000)。我不确定这会如何影响dplyr::count()功能,但安装CRAN版purrr可以解决问题。