如何在R studio中通过URL读取Excel文件?其https

问题描述 投票:0回答:3

我有一个安全的网址,以Excel格式提供数据。我如何在R studio中阅读它?

请提及必要的程序包和功能。我尝试过read.xls()read_xlsxread.URL等。似乎没有任何效果。

r rstudio r-package
3个回答
0
投票

您可以分两步完成。首先,您需要使用download.file之类的文件进行下载,然后使用readxl::read_excel

进行阅读
download.file("https://file-examples.com/wp-content/uploads/2017/02/file_example_XLS_10.xls", destfile = "/tmp/file.xls")
readxl::read_excel("/tmp/file.xls")

0
投票
library(readxl)
library(httr)

url<-'https://......xls'
GET(url, write_disk(TF <- tempfile(fileext = ".xls")))
read_excel(TF)

0
投票

您是否尝试过将其作为.csv数据集导入RStudio?可能值得一试!:)

© www.soinside.com 2019 - 2024. All rights reserved.