Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.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
链接到Github存储库时readRDS出错_R_Github - Fatal编程技术网

链接到Github存储库时readRDS出错

链接到Github存储库时readRDS出错,r,github,R,Github,我正在尝试将我当前的R文件系统转移到Github,以便任何计算机都可以访问它。因此,理想情况下,我希望所有引用文件也存储在Github中。然而,我正在努力将这些数据集(特别是.RDS文件)读入我的R代码。我在网上见过两种方法,对我来说都不成功 url <- "https://github.com/DebbieShack/cholera-in yemen/blob/main/saved_data/WHO_weekly.RDS" data <- readRDS(url

我正在尝试将我当前的R文件系统转移到Github,以便任何计算机都可以访问它。因此,理想情况下,我希望所有引用文件也存储在Github中。然而,我正在努力将这些数据集(特别是.RDS文件)读入我的R代码。我在网上见过两种方法,对我来说都不成功

url <- "https://github.com/DebbieShack/cholera-in yemen/blob/main/saved_data/WHO_weekly.RDS"
data <- readRDS(url(url, method="libcurl"))

url,可能通过使用指向“原始”版本的链接。在文件的Github位置上有一个按钮“Raw”,用于获取此链接。
data <- readRDS(gzcon(url("https://github.com/DebbieShack/cholera-in-yemen/blob/main/saved_data/WHO_weekly.RDS")))