【发布时间】:2019-04-08 01:11:34
【问题描述】:
是否可以将这个文件读入 R,而不必自己手动打开文件并重新保存为 excel 文件。下面显示这个文件实际上不是一个excel文件。
https://www.sec.gov/Archives/edgar/data/320193/000119312511192493/Financial_Report.xls
url <- "https://www.sec.gov/Archives/edgar/data/320193/000119312511192493/Financial_Report.xls"
temp_xls <- tempfile(fileext = ".xls")
download.file(url, destfile = temp_xls, mode = "wb")
readxl::format_from_signature(temp_xls)
#> [1] NA
readr::read_lines(temp_xls, n_max = 5)
#> [1] "MIME-Version: 1.0"
#> [2] "X-Document-Type: Workbook"
#> [3] "Content-Type: multipart/related; boundary=\"----=_NextPart_e3144909_1d60_4840_908e_3419ae0a14d3\""
#> [4] ""
#> [5] "This document is a Single File Web Page, also known as a Web Archive file. If you are seeing this message, your browser or editor doesn't support Web Archive files. Please download a browser that supports Web Archive, such as Microsoft Internet Explorer."
unlink(temp_xls)
1) 目前有没有办法将此文件读入 R
2) 是否可以自动手动打开文件并将其保存为 R 中可读的格式
【问题讨论】:
标签: r