dimNA< -
From R.utils v1.19.3
by Henrik Bengtsson
Sets the dimension of an object with the option to infer one dimension autmatically
Sets the dimension of an object with the option to infer one dimension autmatically.
If one of the elements in the dimension vector
is NA
, then its value
is inferred from the length of the object and the other elements in the
dimension vector. If the inferred dimension is not an integer
, an
error is thrown.
Usage
## S3 method for class 'default':
dimNA(x) <- value
Arguments
Value
- Returns (invisibly) what
dim<-()
returns (seedim
() for more details).
See Also
dim
().
Examples
x <- 1:12
dimNA(x) <- c(2,NA,3)
stopifnot(dim(x) == as.integer(c(2,2,3)))
Community examples
Looks like there are no examples yet.