I have a large array envSST with dimension (720,361,10,276)
I am actually only interested in a small subset of the first two dimensions, given by a 54×2 matrix called lat.lon.ensinds, so I can delete envSST and free up some space.
Two things I have tried:
eSST= t(sapply(1:nrow(lat.lon.ensinds), function (k)
ensSST[lat.lon.ensinds$lon.inds[k], lat.lon.ensinds$lat.inds[k],,])
which results in a matrix of dimension (54,2760) instead of an array of size (54,10,276)
(I tried adding the sapply argument simplify=”array” but it resulted in an error)
eSST=NULL
eSST=rbind(eSST,ensSST[lat.lon.ensinds$lon.inds[k], lat.lon.ensinds$lat.inds[k],,])
which results in a matrix of size (540,276) instead of an array
Any suggestions?
Peter Guttorp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.