shape | R Documentation |
S3 methods for length, dim, names and dimnames
## S3 method for class 'dual'
length(x)
## S3 method for class 'dual'
dim(x)
## S3 replacement method for class 'dual'
dim(x) <- value
## S3 method for class 'dual'
dimnames(x)
## S3 replacement method for class 'dual'
dimnames(x) <- value
## S3 method for class 'dual'
names(x)
## S3 replacement method for class 'dual'
names(x) <- value
x |
a dual object |
value |
for replacement methods, the new value |
As the methods 'dimnames' and 'dimnanes<-.dual' have been defined, you can use 'rownames' and 'colnames' as with numeric matrices (see examples).
Return values are similar to the base methods.
x <- dual( matrix(c(1,0,2,3,2,4), 2, 3) )
dim(x)
length(x)
rownames(x) <- c("L1", "L2")
x
d(x, "x1.1")
# modifying dim is the recommended way to change dual object shape
dim(x) <- NULL
x
# back to matrix shape
dim(x) <- c(2, 3)
x
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.