- 读取文件之前,要了解自己在哪儿(getwd()),明了自己要去哪儿(setwd())
我们下载一个文件操练一下(给大家点儿代入感)
https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE17215

开始正题
- 常用的文件读取命令read.table和read.csv
- 常用的文件存入命令write.table和write.csv
- 读文件前,文件格式(分隔符)、注释内容、行名、列名等需要了解!!!
- 新手可以一点点儿来,参数一个一个加上去,View()或从右上角环境变量看看效果
每个函数的参数都有很多,所以,必须了解Tab键(补全,根据你键入的信息进行联想)

#####comment.char 设置注释的标识符;skip设置跳过行数;其他的参数,大家可以自行意会
a<-read.csv('C:/Users/Administrator/Documents/test/GSE17215_series_matrix.txt')
b<-read.csv('C:/Users/Administrator/Documents/test/GSE17215_series_matrix.txt',comment.char = '!')
d<-read.csv('C:/Users/Administrator/Documents/test/GSE17215_series_matrix.txt',comment.char = '!',sep='\t')
f<-read.table('C:/Users/Administrator/Documents/test/GSE17215_series_matrix.txt',sep = '\t',fill=T,skip=66,header=T)
####dim(询问数据类型的维度)
dim(d)
dim(f)
head(d)
head(f)
tail(d)
tail(f)
write.table(x = f,file = '0418.txt')
以下是我(请叫我小白)经常用到的参数,供参考:

网友评论