从git读取rds压缩文件

时间:2019-03-04 21:13:23

标签: r git gzip rds

我能够从git下载rds文件,但出现错误:

readRDS(temp)错误:在字符串'name \ 0'中嵌入nul

url <- "https://github.com/filename.rds"
temp <- tempfile()
download.file(url,temp,method="libcurl",quiet=TRUE)
print(temp)
unzipped <- gzcon(con=gzfile(temp), level = 6, allowNonCompressed = TRUE, 
text = FALSE)
print(unzipped)
result <- readRDS(unzipped)
close(con)    
unlink(temp)

0 个答案:

没有答案