R语言
1.下载R和Rstudio
2.R语言的基本操作

1画图
plot是图,rnorm是正态分布的函数
plot(rnorm(50))
点状图

boxplot(iris$Sepal.Length~iris$Species,col = c("lightblue","lightyellow","lightpink"))
箱线图
iris是R语言自带的数据库,iris$Sepal.Length表示iris数据框的Sepal.Length这一列数据
2 R语言工作目录
引自生信星球
R语言只能在一个文件夹下进行工作
设置工作目录:setwd()
查看工作目录:getwd()
可以用project建立多个工作目录
-
打开Rstudio,
project是绑定文件夹的。弹出的窗口问你是新建一个文件夹还是使用已经存在的文件夹。我们以新建为例:
填好文件夹名后,(其实给文件夹命名了,也就等于给project命名了,二者同名)点击Create Project,就打开了一个新的session,不干扰你目前正在进行的项目噢。
-
2.打开Rproject
打开这个项目后,用getwd()查看一下,就会发现你的工作目录就是Rproject所在的目录啦。
生信技能树创始人jimmy推荐,只用这一个方法打开Rstudio。那么下次再要打开这个项目时,只需要在文件夹中找到这个R project,双击打开即可。
从此管理多个项目不成问题咯。
你用到的同一个项目的脚本/数据全都默认放在这里。
3 R语言操作












1.安装包,install.packages(“包”)
2.下载好安装包,在本地安装tool-install packages
3.Bioconductor进行安装

总结

网友评论