This is my first time using a 3 dimensional array and I am having problems about naming the third dimension.
ReplicateData <- array(0, c(240, 500, 5), dimnames=list(NULL, NULL, c("Returns", "Replicates", "Asset Class")))
I am getting the error:
Length of dimnames not equal to array extent
This seems like it should be a simple issue but I can't find an explicit example in the help docs or online.
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")))
The third dimension of your array is of extent 5, but the vector of names for that dimension is of length three.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With