clusterDT: Produce a variable cluster datatable

Description Usage Arguments Value See Also Examples

View source: R/clusterDT.R

Description

clusterDT produces a nicely formatted DT::datatable representation of a mt_variable_cluster or mt_variable_cluster_plus object.

Usage

1
2
clusterDT(x, columnFilters = FALSE, highlightVars = NA_character_,
  highlightColor = "yellow", varNameTransform = function(x) {     x })

Arguments

x

mt_variable_cluster or mt_variable_cluster_plus object

columnFilters

logical value; include column filters?

highlightVars

character vector; x$VarName values used to highlight rows

highlightColor

character string; highlight color (valid color)

varNameTransform

function used to transform x$VarName; should take only one parameter and return a character vector of the same length. Example (bold effect): varNameTransform = function(x){paste0("<b>", x, "</b>")}

Value

A datatable representation of a mt_variable_cluster or mt_variable_cluster_plus object.

See Also

variable_cluster, variable_cluster_plus, datatable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# regular variable cluster
x <- variable_cluster(mtcars, 3)
clusterDT(x)

# variable cluster plus info value
x <- variable_cluster(mtcars[names(mtcars) != "vs"], 3)
y <- lapply(mtcars[names(mtcars) != "vs"], woe, y = mtcars$vs)
y <- lapply(y, infoValue)
z <- variable_cluster_plus(x, y)
clusterDT(z)

# variable cluster plus R-squared
x <- variable_cluster(mtcars[names(mtcars) != "mpg"], 3)
y <- lapply(mtcars[names(mtcars) != "mpg"], nrsq, y = mtcars$mpg)
z <- variable_cluster_plus(x, y)
clusterDT(z)

dnegrey/miscTools documentation built on Sept. 19, 2017, 12:15 a.m.