EXCEL(エクセル)ファイルの取り込み

#path
username<-Sys.info()['user']
path01<-paste("C:/Users/",username,"/Desktop/R_Data_Read/",sep="")
path02<-paste("C:/Users/",username,"/Desktop/R_Graph/",sep="")
path03<-paste("C:/Users/",username,"/Desktop/R_Data_Write/",sep="")
#package
library(XLConnect) # http://cran.r-project.org/web/packages/XLConnect/XLConnect.pdf
#url
url<-c(
"http://www.meti.go.jp/statistics/tyo/iip/xls/b2010_gsm1j.xls"
)
setwd(path01)
for(iii in 1:length(url)){
 n.file<-nchar(url[iii])
 for(nnn in n.file:1){
  if(substr(url[iii],nnn,nnn)=="/"){
   filename<-substr(url[iii],nnn+1,n.file)
   break
  }
 }
 download.file(url[iii],filename,mode="wb")
 excel.data<-loadWorkbook(paste(path01,filename,sep=""))
 dataset<-readWorksheet(excel.data, 1, header=F)
 print(head(dataset))
}