Learn R Programming

hierbase (version 0.1.2)

print.hierBase: Print Object of Class hierBase

Description

Print significant clusters or groups of variables of an object of class hierBase.

Usage

# S3 method for hierBase
print(
  x,
  n.terms = 5L,
  digits = max(3, getOption("digits") - 3),
  right = FALSE,
  ...
)

Arguments

x

an object of class hierBase

n.terms

maximum number of column names or variables names to be printed per cluster or group of variables.

digits

number of significant digits to be used.

right

logical value indicating whether the values should or should not be right-aligned.

...

additional arguments to print.data.frame

Value

The returned values is a invisible copy of the object x.

Details

The function prints the significant clusters or groups of variables of an object of class hierBase. 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).

See Also

invisible.

Examples

Run this code
# NOT RUN {
n <- 200
p <- 100
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_vars(x = x)
sign.clusters <- advance_hierarchy(x = x, y = y, dendr = dendr,
                                   test = "F")

# 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 = 6)

# }

Run the code above in your browser using DataLab