d <- ff(c(2,2,4))[1:6,] ## first six rows of the full factorial only
d
## the count vector must have 2*2*4=16 elements,
## the first six must be 1, the last ten must be zero
dToCount(d) ## does not produce the desired result,
## because the first column of d
## does not contain both levels
(d_as_count <- dToCount(d, nlevels=c(2,2,4)))
## corresponds to the above way of creating d
dToCount(d, nlevels=c(2,2,5)) ## would correspond to a different reality,
## where the third factor has in fact 5 levels,
## of which only four are in the array
countToDmixed(c(2,2,4), d_as_count)
## creates d from the count representation
Run the code above in your browser using DataLab