Skip to content
Prev 20821 / 29559 Next

Subset a Raster* object read from a 4D NetCDF file

Dear list members,

Could someone help me to understand the following case (works on
Linux. I don't know for other OS):

library(raster)
out <- brick('http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/godas/pottmp.2013.nc',
lvar=3, level=1, varname='pottmp')

# error while subsetting
pottmp <- subset(out, 1:3)

# multiply by 1
out <- out * 1

# no error
pottmp <- subset(out, 1:3)


Thank you,
Pascal