我正在尝试将 RDS 文件导入 Windows 中的 RStudio,我尝试遵循此 example ,这是用于 Rdata,我尝试了两种方法:
方法一:
githubURL <- ("https://github.com/derek-corcoran-barrios/LastBat/blob/master/best2.My.Lu2.rds")
BestMyyu <- readRDS(url(githubURL))
方法二:
githubURL <- ("https://github.com/derek-corcoran-barrios/LastBat/blob/master/best2.My.Lu2.rds")
download.file(githubURL,"best2.My.Lu2.rds")
BestMyyu <- readRDS("best2.My.Lu2.rds")
我已经寻找了其他线程,但没有找到任何其他示例
最佳答案
在第二种方法中,您只需要添加 method="curl"
并将 url 更改为指向 raw
(页面上有下载链接)
githubURL <- ("https://raw.githubusercontent.com/derek-corcoran-barrios/LastBat/master/best2.My.Lu2.rds")
download.file(githubURL,"best2.My.Lu2.rds", method="curl")
BestMyyu <- readRDS("best2.My.Lu2.rds")
如果您没有
curl
已安装,您可以从 here 获取它
关于r - 将 RDS 文件从 github 导入 R Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40138822/