R语言正式开始
一、数据类型重点掌握
重点掌握向量和数据框
二、读取本地数据
read.table函数要重点掌握
read.table(file = "huahua.txt",sep = "\t",header =T)
a<-read.table(file = "huahua.txt",sep = "\t",header =T)
三、设置行名和列名
X<-read.csv('doudou.txt')
colnames(X)
rownames(X)
colnames(X)[1]<-"bioplanet"
X<-read.csv(file = "huahua.txt",sep = "\t",header =T,row.names=1)
四、导出
write.table(X,file = "yu.txt",sep = ",",quote=F)
五、保存与重新加载
save.image(file="bioinfoplanet.RData")
save(frame1,file="frame1.RData")
load("frame1.RData")
六、提取元素
X[x,y]
X[x,]
X[x,]
X[y]
X[a:b]
X[c(a,b)]
X$列名