读取txt文件
a<-read.table("GEO14333.txt",sep="/t",header=T)
##sep="/t"读取的方式,按列进行读取;
##header=T默认显示表头
读取GEO数据库下载的压缩文件
a<read.table("GEO14333_series_matrix_txt.gz",sep="/t",header=T,comment.char="!)
#comment.char="!",不读取感叹号开头的那几列注释信息
##header=T默认显示表头
保存文件
write.csv(a,file="表达矩阵.csv")
b<-read.csv(file="表达矩阵.csv")
##
save(b,file="b.Rdata")
write.table(file = "GEO35896.txt", all_df, sep = "\t", col.names = T, row.names = F, quote = F)
读取excel文件
library(readxl)
d<-read_excel(path = "gene_list.xlsx")

本文详细介绍使用R语言读取和保存各种文件格式的方法,包括txt、csv和excel等,展示了如何处理GEO数据库下载的压缩文件,以及如何在读取过程中排除注释信息。
3503

被折叠的 条评论
为什么被折叠?



