sorry to post this as I know this has come up before in various guises but I really don't understand what I am doing wrong/the inner-workings of R!
I have an (multi dimensional) array of data that I have read in from a netcdf file that I am playing around with. I would like to calculate some "stats" on parts of the array for example:
data <- array(runif(96*73*26*12), dim=c(96,73,26,12))
part.mean <- apply(data[10:23, 42:56, ,], c(3,4), mean)
Works great. But:
part.sd <- apply(data[10:23, 42:56, ,], c(3,4), sd)
Fails.
What is the correct way then to subset my array and calculate the sd associated with the mean that I can calculate above?
Thanks for your time!
Alex