Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. downloadxlsx<-function(url,sheet){
  2. library(gdata)
  3. tmp = tempfile(fileext = ".xlsx")
  4. download.file(url = url, destfile = tmp, mode="wb")
  5. #toc<-read.xls(tmp,sheet=1)
  6. read.xls(tmp,sheet=sheet)
  7. }
  8.  
  9. temp<-data.frame(downloadxlsx("https://www.bls.gov/web/empsit/compaeu.xlsx",sheet=1),stringsAsFactors = F)
  10. colnames(temp)<-temp[2,]
  11. temp<-temp[3:12,]
  12. View(temp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement