labels: Extract labels from a tskrr object

Description Usage Arguments Value Warning

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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!


xnet documentation built on Feb. 4, 2020, 9:10 a.m.