美文网首页
R day 1- 基本操作-1

R day 1- 基本操作-1

作者: labrador1986 | 来源:发表于2018-12-08 23:08 被阅读0次

R 和Rstudio的区别

举个例子:R就像一个裸奔的windows系统
Rstudio给你集成了QQ,浏览器,微信,播放软件,office套件等等,更加便捷,但是核心还是R

更换镜像

options()$repos
options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
options()$BioC_mirror
options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/")
options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))

也可以手动设置

安装包

install.packages("dplyr")#注意安装包的时候必须双引号

如果普通install.packages方式找不到包,说明包可能在bioconductor上,用另外一种安装即可

source("https://bioconductor.org/biocLite.R") 
library('BiocInstaller') 
options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/") 
BiocInstaller::biocLite("GEOquery")

运行包

library(dplyr)#注意安装包的时候必须双引号

查看/设置当前工作目录

getwd()
setwd("C:/Users/Administrator/Desktop/R/basic")#注意从win负责过来的时候需要修改反斜杠

大神们都说了:打开R只有一种方式!!!!就是打开.Rproj文件,这个.Rproj文件就是你当前所在文件夹的快捷方式,自动记录你的wd.

新手一定要养成这个习惯

相关文章

网友评论

      本文标题:R day 1- 基本操作-1

      本文链接:https://www.haomeiwen.com/subject/elifhqtx.html