Naming array dimensions gives error: length of 'dimnames' not equal to array extent Naming array dimensions gives error: length of 'dimnames' not equal to array extent arrays arrays

Naming array dimensions gives error: length of 'dimnames' not equal to array extent


The third dimension of your array is of extent 5, but the vector of names for that dimension is of length three.


Since I understand answers better with a bit 'o code to guide me... here is Jonathan Chang's correct answer translated to code:

ReplicateData <- array(0,c(240,500,5),dimnames=list(NULL, NULL,   c("Returns","Replicates","Asset Class", "Fourth Dimname", "Fifth Dimname")))