install.packages("dplyr")also installing the dependencies ‘cli’, ‘lifecycle’, ‘pillar’, ‘rlang’, ‘tibble’, ‘tidyselect _ls6yx_37pjtzps5yqh0000gn/T//RtmpsObKqI/downloaded_packagesinstalling the source packages ‘rlang’, ‘tidyselect 763765 bytes (745 KB)downloaded 745 KBtrying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/tidyselect ’ ...** package ‘tidyselect’ successfully unpacked and MD5 sums checked** using staged installation** final location** testing if installed package keeps a record of temporary installation path* DONE (tidyselect
介绍 ggplot2里aes()可以用tidyselect风格去选择变量做映射绘图,那么这种情况下如何实现「变量替换」呢? 首先说下我为什么要实现「变量替换」。
dplyr 包的 select 系列函数在这里可以派上用场,尤其是将这些函数与 tidyselect 包的 starts_with( )、ends_with( ) 和 contains( ) 等函数联合使用会带来诸多便利 先加载这两个包: library(dplyr) library(tidyselect) 接下来举例说明如何使用 select 系列函数选择或剔除变量。
1 a 1 ## 2 a 2 ## 3 b 1 ## 4 b 2 支持tidyselect
roxygen2", "Seurat", "SeuratObject", "stringr", "tibble", "tidyr", "tidyselect
selections is ambiguous.i Use `all_of(vars)` instead of `vars` to silence this message.i See <https://tidyselect.r-lib.org
purrr (>= 1.0.1), R6 (>= 2.2.2), rlang (>= 1.1.1), tibble (>= 3.2.1), tidyr (>= 1.3.0), tidyselect
Excel数据包 library(readxl) df2<-read_excel("ggalluvial_test_data.xlsx") #检查是否符合绘制需求 is_alluvia_form(df2, tidyselect
selections is ambiguous.i Use `all_of(vars)` instead of `vars` to silence this message.i See <https://tidyselect.r-lib.org
_0.3.4 cli_1.1.0 [15] rstudioapi_0.10 withr_2.1.2 dplyr_0.8.1 grid_3.6.0 tidyselect
backports_1.1.7 R6_2.4.1 ## [9] colorspace_1.4-1 withr_2.2.0 tidyselect
_1.4.3 modelr_0.1.1 ## [31] pkgconfig_2.0.2 mnormt_1.5-5 htmltools_0.3.6 ## [34] tidyselect
recipe,然后是选择预处理步骤,在recipes中,所有的数据预处理步骤都是以step_xxx这种形式出现的; 然后是预处理应用于哪些变量,可以直接写变量名字,和dplyr中一模一样的方法,所以也支持tidyselect
DBI_1.1.3 ## [10] colorspace_2.0-3 nnet_7.3-17 withr_2.5.0 ## [13] tidyselect
ggplot2_3.3.2 ## ## loaded via a namespace (and not attached): ## [1] tinytex_0.24 tidyselect
rprojroot_1.3-2 desc_1.2.0 #> [67] stringi_1.4.3 Rcpp_1.0.1 tidyselect
1.0.4 compiler_4.3.3 timechange_0.3.0 [16] pkgconfig_2.0.3 rstudioapi_0.16.0 R6_2.5.1 tidyselect 2.0.0 gridExtra_2.3 ggplot2_3.5.1 cowplot_1.1.3 loaded via a namespace (and not attached): [1] tidyselect
## [40] Matrix_1.7-2 splines_4.4.3 nnet_7.3-20 ## [43] timechange_0.3.0 tidyselect
purrr_0.3.2 munsell_0.5.0 [21] compiler_3.6.2 pkgconfig_2.0.3 colorspace_1.4-1 tidyselect
", "Seurat", "SeuratObject", "stringr", "tibble", "tidyr", "tidyselect ", "Seurat", "SeuratObject", "stringr", "tibble", "tidyr", "tidyselect