View source: R/datacggm_S3methods.R
dim.datacggm | R Documentation |
Retrieve the dimension of an R object of class “datacggm”, that is, the sample size (n), the number of response variables (p) and the number of predictors (q).
## S3 method for class 'datacggm' dim(x)
x |
an R object of class ‘ |
For an R object of class ‘datacggm
’, dim
retrieves a list with elements named Y
and X
. The first component is the “dim
” attribute of the matrix Y
whereas the second component is the “dim
” attribute of the matrix X
. If X
is missing, the second component is NULL
.
For an object of class ‘datacggm
’, dim
retrieves a named list with components Y
and X
which are the “dim
” attribute of the two matrices, respectively. If X
is missing then the last component is NULL
.
Luigi Augugliaro (luigi.augugliaro@unipa.it)
datacggm
, rcggm
,nobs
, nresp
and npred
.
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) dim(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) dim(Z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.