生信星球培训第92期

学习小组Day6笔记-甜甜圈

2020-12-18  本文已影响0人  甜甜圈1314

1.安装R包

镜像设置

options()$repos查看所用镜像
1)用Rstudio代码设置镜像

options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")) #对应清华源
options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/") #对应中科大源

2)R的配置文件(一劳永逸法)

file.edit('~/.Rprofile')

在打开的.Rprofile中写入代码

options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")) #对应清华源
options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/") #对应中科大源

保存并重启Rstudio

安装

#安装:
install.packages(“包”)
BiocManager::install(“包”)
#加载:
library(包)
require(包)

R的几种利器包(package),如dplyr(数据处理神包)、ggplot2(画图神器)、shiny(网页开发神包)、rvest(网络数据爬取)、sp(地理数据分析包)等。

2. dplyr包

5个基本函数

mutate()
select()1
select()2
filter()
arrange()
summarise()

2个实用技能

1)管道操作%>% (windows快捷键ctrl+shift+M)
参考文章:R语言中的管道%>%

管道%>%
2)count
count()

处理关系数据

1)各种join


连接

2)两个bind


合并

思维导图

dplyr包
上一篇 下一篇

猜你喜欢

热点阅读