labels.tskrr {xnet}R Documentation

Extract labels from a tskrr object

Description

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.

Usage

## S3 method for class 'tskrr'
labels(
  object,
  prefix = if (is_homogeneous(object)) "row" else c("row", "col"),
  ...
)

## S4 method for signature 'tskrr'
labels(
  object,
  prefix = if (is_homogeneous(object)) "row" else c("row", "col"),
  ...
)

## S4 method for signature 'tskrr'
dimnames(x)

## S4 method for signature 'tskrr'
rownames(x, do.NULL = TRUE, prefix = "row")

## S4 method for signature 'tskrr'
colnames(x, do.NULL = TRUE, prefix = "col")

Arguments

object

a tskrr object

prefix

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.

x

a tskrr object

do.NULL

logical. If FALSE and labels are NULL, labels are created. If TRUE, the function returns NULL in the absence of labels.

Value

for labels and dimnames: a list with two elements k and g

Warning

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!


[Package xnet version 0.1.11 Index]