How can I read RData with httr? I tried a couple of things but I got error
a)
download.file(downloadURL, "temp.rData")
load("temp.rData")
b)
bin = getBinaryURL(downloadURL, ...yourOtherParams...)
writeBin(bin, "temp.rData")
load("temp.rData")
from thread Download .RData and .csv files from FTP using RCurl (or any other method)
and also using 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")
but I get the error
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
How can I fix this?
Thanks Ganesh
答案 0 :(得分:1)
这对我有用:
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-page的Download-button以获取原始文件。