R语言读取EXCEL数据

要用的包xlsx

#读取函数read.xlsx()
df<-read.xlsx("data.xlsx",sheetIndex=1)
函数 参数
read.xlsx() file,sheetIndex,sheetName=NULL,rowIndex=NULL,startRow=NULL,endRow=NULL, colIndex=NULL,as.data.frame=TRUE, header=TRUE, colClasses=NA,keepFormulas=FALSE, encoding=“unknown”, password=NULL, …

循环读取EXCEL中的sheet表

sheetIndex<-1:5
for (i in sheetIndex)
{
  df<-read.xlsx("data.xlsx",sheetIndex=i)
}
原文地址:https://www.cnblogs.com/cqy-wt1124/p/15241052.html