readRDS中的错误
我正在运行Rv3.4.3,当我试图读取一个公开可用的rds文件时,我看到一个错误readRDS中的错误,r,R,我正在运行Rv3.4.3,当我试图读取一个公开可用的rds文件时,我看到一个错误 >githubURL<-("https://github.com/ChongWu-Biostat/aSPUpath2/blob/master/Example/example.stat.rds") >download.file(githubURL,"example.stat.rds", method="curl") >example.stat<-readRDS("example.stat
>githubURL<-("https://github.com/ChongWu-Biostat/aSPUpath2/blob/master/Example/example.stat.rds")
>download.file(githubURL,"example.stat.rds", method="curl")
>example.stat<-readRDS("example.stat.rds")
Error in readRDS("example.stat.rds") : unknown input format
>githubURLdownload.file(githubURL,“example.stat.rds”,method=“curl”)
>stat该URL指向该文件的网页。您已下载HTML并尝试将其作为.RDS加载。如果查看.RDS文件,您将看到
您确实需要原始数据的URL:
> url = "https://raw.githubusercontent.com/ChongWu-Biostat/aSPUpath2/master/Example/example.stat.rds"
> download.file(url,"example.stat.rds", method="curl")
[download progress...]
> example.stat<-readRDS("example.stat.rds")
>url=”https://raw.githubusercontent.com/ChongWu-Biostat/aSPUpath2/master/Example/example.stat.rds"
>下载.file(url,“example.stat.rds”,method=“curl”)
[下载进度…]
>statI用您的代码读取此文件没有问题,但下载对我不起作用。我不得不手工下载。