object of type 'S4' is not subsettable
I'm trying to load some extreme indices and I'm getting the following error for some of them:
Error in data_array[matrix_indices] <- as.vector(do.call("[", c(list(x = sub_array), :
object of type 'S4' is not subsettable
I'm very lost because the files seem to be in an identical format, and the error only occurs for some of them. For example, the DTR index is correctly loaded, but the FD index is not:
DTR <- Start(dat = '/esarchive/obs/ukmo/hadex3/original_files/1961-90/HadEX3_$var$_MON.nc',
var = 'DTR',
time = indices(1),
longitude = indices(1),
latitude = indices(1),
num_procs = 1,
retrieve = TRUE)
FD <- Start(dat = '/esarchive/obs/ukmo/hadex3/original_files/1961-90/HadEX3_$var$_MON.nc',
var = 'FD',
time = indices(1),
longitude = indices(1),
latitude = indices(1),
num_procs = 1,
retrieve = TRUE)
Also, I have tried to load the index that fails (FD) with the ncdf4 library and it correctly loads the data:
file <- ncdf4::nc_open('/esarchive/obs/ukmo/hadex3/original_files/1961-90/HadEX3_FD_MON.nc')
data <- ncdf4::ncvar_get(file)
Could you please take a look? There is no rush with this issue.
Thanks a lot in advance,
Carlos