Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dimNALT_-

Sets the dimension of an object with the option to infer one dimension automatically


Description

Sets the dimension of an object with the option to infer one dimension automatically. 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

## Default S3 replacement method:
dimNA(x) <- value

Arguments

x

An R object.

value

NULL of a positive numeric vector with one optional NA.

Value

Returns (invisibly) what dim<-() returns (see dim() for more details).

Author(s)

Henrik Bengtsson

See Also

dim().

Examples

x <- 1:12
  dimNA(x) <- c(2,NA,3)
  stopifnot(dim(x) == as.integer(c(2,2,3)))

R.utils

Various Programming Utilities

v2.10.1
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.