Really simple problem with the raster package, also using ncdf4 to load in an ECMWF Era-Interim Netcdf file.
Simply doing this:
a <- nc_open("SSTs.nc")
B <- brick(a, varname="sst")
Returns this:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘brick’ for signature ‘"ncdf4"’
The file is just SST data over the whole globe, for 1 month (Jan2016). When I convert it into an array (i.e. extract dimensions/variable, and convert time to UTC, shove it into an array) I don't get the same error, but the raster package says it supports .nc files straight in (so long as they're cf-1 compatible, which Era-Interim .nc's are)
Any help much appreciated, have tried this with many Netcdf files (non-Era Interim too).