Read Excel file into R with XLConnect package from URL

前端 未结 4 1660
轮回少年
轮回少年 2020-12-19 21:32

There are lots of good examples out there on how to read Microsoft Excel files into R with the XLConnect package, but I can\'t find any examples of how to read in an Excel f

4条回答
  •  孤城傲影
    2020-12-19 22:17

    library(relenium)
    library(XML)
    library(RCurl)
    
    firefox=firefoxClass$new()
    url="https://www.misoenergy.org/Library/Repository/Market%20Reports/20140610_sr_nd_is.xls"
    url=sprintf(url)
    firefox$get(url)
    

    This will open a Firefox instance within R and ask you to download the file, which you could then open in the next line of code. I don't know of any R utilities that will open an excel spreadsheet from HTTPS.

    You could then set a delay while you're saving the file and then read the sheet from your downloads folder:

    Sys.sleep(10)
    sheet <- c("Sheet1")
    data  <- readWorksheetFromFile(path, sheet, header=TRUE, startRow=11, startCol=2, endCol=13)
    

提交回复
热议问题