dimdim: Length and Dimensions of Vector, Matrix, Array, Data.Frame,...

Description Usage Arguments Examples

View source: R/e_conversion.R

Description

Dimensions and length of vector, matrix, array, data.frame and list. A friendly version of dim that returns the true dimension rather than the sometimes unexpected NULL value. The number of dimensions appears first, then the length in each dimension. A special case is list: the list's length (number of items) is turned into a negative integer and the dimension/length of each item is either positive if the item is a vector, matrix, array or data.frame or negative if the item is itself a list. Only the first level of the list is explored.

dimdim1 and dimdimc return the first item of dimdim, thus the true dimension, either as an integer or as a character and, in this latest case, always "-1" for lists.

Notes: From version 1.6.2 (April 2016), dimdim(NULL) = c(0, 0). (before c(1, 0)). Hence, dimdim1(NULL) = 0 and dimdimc(NULL) = "0". Some problems may occur with S4 objects like dimdim(qualityTools::fracDesign(k = 3, gen = "C = AB")).

Usage

1
2
3
4
5

Arguments

x

vector, matrix, array, data.frame, list.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21

FatTailsR documentation built on March 12, 2021, 9:06 a.m.

Related to dimdim in FatTailsR...