read.xls(gdata) - 来自https网址 [英] read.xls (gdata) - from an https url

查看:483
本文介绍了read.xls(gdata) - 来自https网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从URL读取excel文件:
https://www.misoenergy.org/Library/Repository/Market%20Reports/20140507_sr_la.xls

I'm trying to read in an excel file from a URL: https://www.misoenergy.org/Library/Repository/Market%20Reports/20140507_sr_la.xls

我可以下载文件,并使用gdata包中的read.xls读取它没问题。

I can download the file, and read it in using read.xls from the gdata package no problem.

但我在尝试直接读取时遇到错误。

But I get an error when trying to read it in directly.

    Unable to open file 'https://www.misoenergy.org/Library/Repository/Market%20Reports/20140507_sr_la.xls'.
    Error in xls2sep(xls, sheet, verbose = verbose, ..., method = method,  : 
      Intermediate file '/tmp/RtmptxiYS1/file42f8532a0129.csv' missing

我试过这个:
使用url使用read.xls导入Excel文件但是'https'中的's'是必需的。

I've tried this: Importing Excel file using url using read.xls but the 's' in 'https' is required.

推荐答案

试试这个

library(gdata)
tmp <- tempfile()
download.file("https://www.misoenergy.org/Library/Repository/Market%20Reports/20140507_sr_la.xls", 
              destfile=tmp, method="curl")

read.xls(tmp, skip=2)
unlink(tmp)

这篇关于read.xls(gdata) - 来自https网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆