Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
readRDS中的错误_R - Fatal编程技术网

readRDS中的错误

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

我正在运行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.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用您的代码读取此文件没有问题,但下载对我不起作用。我不得不手工下载。