【发布时间】:2017-04-06 10:26:08
【问题描述】:
光栅包的问题非常简单,也使用 ncdf4 加载 ECMWF Era-Interim Netcdf 文件。
只需这样做:
a <- nc_open("SSTs.nc")
B <- brick(a, varname="sst")
返回这个:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘brick’ for signature ‘"ncdf4"’
该文件只是全球 1 个月(2016 年 1 月)的 SST 数据。当我将其转换为数组(即提取维度/变量,并将时间转换为 UTC,将其推入数组)时,我没有收到相同的错误,但 raster 包说它直接支持 .nc 文件(这么久因为它们与 cf-1 兼容,而 Era-Interim .nc 是)
非常感谢任何帮助,已经尝试过许多 Netcdf 文件(非 Era Interim 也是如此)。
【问题讨论】:
-
能否提供示例数据集,也可以尝试使用
stack或使用以前的ncdf package -
同样的问题【读取Netcdf子分类并转为网格】stackoverflow.com/questions/33784940/…
-
感谢您的回复。使用堆栈返回:data.frame 中的错误(values = unlist(unname(x)), ind = factor(rep.int(names(x), : arguments imply different number of rows: 1654, 16 示例数据集是这样的: drive.google.com/open?id=0Bz0W7Ut_SNfjcjg1ODVrc2FhN2s
-
@Ndharwood 使用
s <- stack("SSTs.nc")应该没有问题