I am a little bit stuck with one exercise in a beginner R course that I need for the following exercises (we should replace values of the previously created object).
Create object A, which returns the following when the structure is queried:
> str(A)
num [1 : 2, 1 : 5, 1 : 3] TRUE FALSE TRUE FALSE TRUE FALSE ...
- attr(, "dimnames")=List of 3
..$ : chr [1:2] "a" "b"
..$ : chr [1:5] "C1" "C2" "C3" "C4" ...
..$ : chr [1:3] "X" "Y" "Z"
Because I am a little bit clueless with the content, that is my beginning:
a <- rep(c(0,1),15)
A <- array(a, dim= c(2,5,3))
rownames(A) <- letters[1:2]
colnames(A) <- paste("C",1:5,sep="")
Unfortunately I struggle with the object itself, I don't see how the array should be filled to be numeric and have a TRUE/FALSE content. Also the naming of the third dimension is something where I didn't find sufficient information.
Can anyone help me here?