print.hierT {hierinf} | R Documentation |
hierT
Print significant clusters or groups of variables of an object of class
hierT
.
## S3 method for class 'hierT' print(x, ..., n.terms = 5L, right = FALSE)
x |
an object of class |
... |
additional arguments to |
n.terms |
maximum number of column names or variables names to be printed per cluster or group of variables. |
right |
logical value indicating whether the values should or should not be right-aligned. |
The function prints the significant clusters or groups of variables
of an object of class hierT
. By default, it prints at most the first
n.terms
column or variable names per significant cluster and the
number of omitted column names are printed in square brackets (if any).
The returned values is a invisible copy of the object x
.
Renaux, C. et al. (2018), Hierarchical inference for genome-wide association studies: a view on methodology with software. (arXiv:1805.02988)
n <- 200 p <- 500 library(MASS) set.seed(3) x <- mvrnorm(n, mu = rep(0, p), Sigma = diag(p)) colnames(x) <- paste0("Var", 1:p) beta <- rep(0, p) beta[c(5, 20, 46)] <- 1 y <- x %*% beta + rnorm(n) dendr <- cluster_var(x = x) sign.clusters <- test_hierarchy(x = x, y = y, dendr = dendr, family = "gaussian") # The argument n.terms is useful if there is one or multiple # significant groups containing many variables. # print(sign.clusters, n.terms = 4) print(sign.clusters, right = TRUE) print(sign.clusters, digits = 4)