Description Usage Arguments Details Value Examples
These functions provide an easy way to change the dimnames
, rownames
or colnames
of
an array.
1 2 3 |
x |
An array with dimnames |
dim |
A vector that indicates the dimensions |
... |
A sequence of named arguments |
gsub |
a logical value; if TRUE, |
fixed |
a logical value, passed to |
warn |
logical; should a warning be issued if the pattern is not found? |
dimrename
changes the dimnames of x
along dimension(s) dim
according to the
remaining arguments. The argument names are the old
names, the values are the new names.
rowrename
is a shorthand for changing the rownames,
colrename
is a shorthand for changing the colnames of a matrix
or matrix-like object.
If gsub
is FALSE, argument tags are the old
dimnames
, the values are the new dimnames
.
If gsub
is TRUE, arguments are substrings of the dimnames
that are substituted by the argument values.
Object x
with changed dimnames.
1 2 3 4 5 6 7 8 9 10 |
Loading required package: lattice
Loading required package: MASS
Attaching package: 'memisc'
The following objects are masked from 'package:stats':
contr.sum, contr.treatment, contrasts
The following object is masked from 'package:base':
as.array
A B
a 1 1
b 1 1
A B
first 1 1
second 1 1
A B
a 1 1
b 1 1
Warning messages:
1: In dimrename(m, 1, A = "first", B = "second") :
unused dimname(s) selected
2: In dimrename(m, 1, A = "first", B = "second") :
unused dimname(s) selected
first second
a 1 1
b 1 1
A B
first 1 1
second 1 1
first second
a 1 1
b 1 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.