I have a list in R within which there is data (Data
):
#create data
tmintest=array(1:100, c(12,256,512))
#create the list
Variable <- list(varName = c("tmin","tmin","tmin","tmin","tmin","tmin","tmin","tmin","tmin","tmin","tmin","tmin"),level = c(NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA))
Data <- tmintest
xyCoords <- list(x = seq(-40.37,64.37,length.out=420), y = seq(25.37,72.37,length.out=189))
Dates <- list(start = seq(as.Date("2012-01-01"), as.Date("2015-12-31"), by="days"), end=seq(as.Date("2012-01-01"), as.Date("2015-12-31"), by="days"))
All <- list(Variable = Variable,Data=Data, xyCoords=xyCoords,Dates=Dates)
How can I find exactly where the maximum number in ALL$Data
is occurring? For example, if it is the 4th row, 100th column on the first 'slice' or 'grid' I want back: [1,4,100].
I tried which.max(All$Data) but that just returns a single number?