These functions allow you to extract the labels from a
tskrr
object. The function labels
and the
function dimnames
are aliases and do the exact same
thing. The functions rownames
and colnames
work like
you would expect. Note that contrary to the latter two, labels
will never return NULL
. If no labels are found, it will construct
labels using the prefixes defined in the argument prefix
.
# S3 method for tskrr
labels(
object,
prefix = if (is_homogeneous(object)) "row" else c("row", "col"),
...
)# S4 method for tskrr
labels(
object,
prefix = if (is_homogeneous(object)) "row" else c("row", "col"),
...
)
# S4 method for tskrr
dimnames(x)
# S4 method for tskrr
rownames(x, do.NULL = TRUE, prefix = "row")
# S4 method for tskrr
colnames(x, do.NULL = TRUE, prefix = "col")
a tskrr
object
a prefix used for construction of the labels in case
none are available. For label
, a character vector of length 1 for
homogeneous networks or of length 2 for heterogeneous networks.
In case two values are given, the first is used for the rows and the second
for the columns. Otherwise the only value is used for both. In the case of
rownames
and colnames
, a single value.
See also row+colnames
arguments passed to/from other methods.
a tskrr
object
logical. If FALSE
and labels are NULL
,
labels are created. If TRUE
, the function returns NULL
in
the absence of labels.
for labels
and dimnames
: a list with two elements k
and
g
If the original data didn't contain row- or column names for the
label matrix, rownames
and colnames
will return
NULL
. Other functions will extract the automatically generated
labels, so don't count on rownames
and colnames
if you
want to predict output from other functions!