如何使用httr读取RData?我试了几件事,但我错了
a)
download.file(downloadURL, "temp.rData")
load("temp.rData")b)
bin = getBinaryURL(downloadURL, ...yourOtherParams...)
writeBin(bin, "temp.rData")
load("temp.rData")从线程Download .RData and .csv files from FTP using RCurl (or any other method)
同时也使用httr
c)
a=GET("https://github.com/tvganesh/yorkrData/blob/master/IPL/IPL-T20-matches/Chennai%20Super%20Kings-Deccan%20Chargers-2008-05-06.RData")
writeBin(a$content,"aa.RData")
load("aa.RData")但我明白错误
Error: bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘t.rData’ has magic number '<'
Use of save versions prior to 2 is deprecated我怎么才能解决这个问题?
谢谢加内什
发布于 2016-08-31 13:01:59
这对我起了作用:
load(url("https://github.com/tvganesh/yorkrData/raw/master/IPL/IPL-T20-matches/Chennai%20Super%20Kings-Deccan%20Chargers-2008-05-06.RData"))我从RData-文件中得到一个数据交换的overs。
该url从github页面的下载按钮中获取原始文件。
https://stackoverflow.com/questions/39249377
复制相似问题