dimnames.datacggm {cglasso} | R Documentation |
Dimnames of a “datacggm” Object
Description
Retrieve or set the dimnames of a “datacggm” object.
Usage
## S3 method for class 'datacggm'
dimnames(x)
## S3 replacement method for class 'datacggm'
dimnames(x) <- value
Arguments
x |
an object of class ‘ |
value |
a nested list with names ‘ |
Details
For an R object ‘x
’ of class ‘datacggm
’, dimnames
retrieves or sets the dimnames
attribute for the matrices Y
and X
(see ‘datacggm
’ for more details). When setting the dimnames
attribute, value$Y
can be NULL
(which is not stored) or a list of length two. In the last case, value$Y
is passed to the method function dimnames
for setting the dimnames
attributes of the matrix retrieved by getMatrix(x, "Y")
. In the same way, value$X
can be used for setting the dimnames
attributes of the matrix retrieved by getMatrix(x, "X")
.
Author(s)
Luigi Augugliaro (luigi.augugliaro@unipa.it)
See Also
datacggm
, rcggm
, getMatrix
, rowNames
and colNames
.
Examples
set.seed(123)
# a dataset from a censored Gaussian graphical model
n <- 100L
p <- 3L
b0 <- rep(0, p)
Z <- rcggm(n = n, b0 = b0, probl = 0.05, probr = 0.05)
dimnames(Z)
dimnames(Z) <- list(Y = list(paste0("i", seq_len(n)), paste("Y", 1:p, sep = ":")))
dimnames(Z)
# the same as
# dimnames(Z)$Y <- list(paste0("i", seq_len(n)), paste("Y", 1:p, sep = ":"))
# dimnames(Z)
# a dataset from a conditional censored Gaussian graphical model
n <- 100L
p <- 3L
q <- 2
b0 <- runif(p)
B <- matrix(runif(q * p), nrow = q, ncol = p)
X <- matrix(rnorm(n * q), nrow = n, ncol = q)
Z <- rcggm(n = n, b0 = b0, X = X, B = B, probl = 0.05, probr = 0.05)
dimnames(Z)
dimnames(Z) <- list(Y = list(NULL, paste("Y", 1:p, sep = ":")),
X = list(NULL, paste("X", 1:q, sep = ":")))
dimnames(Z)
# the same as
# dimnames(Z)$Y <- list(NULL, paste("Y", 1:p, sep = ":"))
# dimnames(Z)$X <- list(NULL, paste("X", 1:q, sep = ":"))
# dimnames(Z)