It behaves like a document on the sd help page. At the very top, it announces:
"If x is a matrix or data frame, the column standard deviation vector is returned."
Note that it does not say that arrays are included, therefore only arrays with two dimensions are included. If you want to stop this behavior, just make a vector from it with c ():
sd( c(array(rnorm(60),dim=c(12,5))) )
I see that you added a query to evaluate the z column. Try this for matrices:
colMeans(x)/sd(x)
And this is for arrays (although the definition of a "column" may require clarification:
apply(x, 2:3, mean)/apply(x, 2:3, sd)
source share