我想从R中的eumetsat打开MUlti传感器降水数据。我只能使用GZIP压缩方法获得这些数据,数据格式类型是GRIB。当我下载数据时,我得到tar文件。 如何在R中打开这些数据? 我试图用代码如何读取R中的gzip压缩grib文件?
> untar("1098496-1of1")
但得到错误信息
Error in gzfile(path.expand(tarfile), "rb") : cannot open the connection
In addition: Warning message:
In gzfile(path.expand(tarfile), "rb") :
cannot open compressed file '1098496-1of1', probable reason 'No such file or directory'
,但我当我使用下面的代码:
> dir.create("rainfalldataeumetstatR")
> getwd()
[1] "C:/Users/st/Documents"
> untar("1098496-1of1.tar")
> untar("1098496-1of1.tar", files="rainfalldataeumetstatR")
> list.files("rainfalldataeumetstatR")
我不明白一些文件在我的目录中,并得到答案:
character(0)
可能是因为tar zip中的文件是gz压缩文件而出现该错误?
用'getwd()'验证你的目录是否正确。 – josliber
我已经做到了,我得到了 [1]“C:/ Users/st/Documents”,我的文件位于同一个目录中...我的g =文件的全名是1098496-1of1,文件是WinRAR档案(.tar)。可能问题是文件名? – user3642191
哦,是的,那么你需要通过''1098496-1of1.tar''到函数 – josliber