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

dim_na

Set the dimension of an object


Description

Set the dimension of an object

Usage

dim_na(x) <- value

Arguments

x

An R object, e.g. a list environment, a matrix, an array, or a data frame.

value

A numeric vector coerced to integers. If one of the elements is missing, then its value is inferred from the other elements (which must be non-missing) and the length of x.

Value

An object with the dimensions set, similar to what dim(x) <- value returns.

Examples

x <- 1:6
dim_na(x) <- c(2, NA)
print(dim(x))  ## [1] 2 3

listenv

Environments Behaving (Almost) as Lists

v0.8.0
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.