r - 将 RDS 文件从 github 导入 R Windows

标签 r import

我正在尝试将 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/

相关文章:

r - 合并具有重复项的 data.frames

基于字符向量重新排序数据框

Python 导入在 Windows 中失败,但在 Linux 中不会

python - 冲突的进口

python-3.x - 如何将SEC txt文件读入 Pandas 数据框?

python - 在测试 python 脚本时模拟缺乏依赖性

R:在 ggplot2 图中按值而不是按字母顺序对方面进行排序

r - 如何使用 rmongodb 通过 ObjectId 查询文档

r - 如何在filter_at中使用.data?

python - 如何在 Python 中从其他项目中导入函数?