ggstat: Generate a ggplot for the statistics in different levels...

Description Usage Arguments Value Examples

View source: R/ggstat.R

Description

level.stat provides the useful statistics for different levels (groups) in the given independent variables.

Usage

1
2
3
4
5
ggstat(data, var = "Variable.IV", x = "Group", y = "Rate.1",
  y.label = "Perc.1", y.label.col = "red", y.title = NULL,
  bar.col = "cornflowerblue", width = "Rate.group",
  width.label = "Perc.group", width.label.col = "black", ncol = NULL,
  theme = c("classic", "ws"), background = "white")

Arguments

data

The data frame used for the ggplot. It is usually the output from level.stat. It can be other data frame, if the structure of the data is appropriate.

var

The column represents the variables, which is used as the head in each plot panel.

x

The variable used as x axis

y

The variable used as y axis

y.label

The text used to label the y value

y.label.col

The color of the y.label text

y.title

The title of y axis for the whole plot

bar.col

The color of the bar

width

The column used to represents the width of the bar, or a contant numeric value.

width.label

The text used to label the Width of the bar

width.label.col

The color of the width.label text

ncol

Number of column for the plot

theme

The theme of the plot. It can be 'classic' or 'ws' (Wall Street)

background

The background color

Value

a data frame inclduing frequency, rates, Weight of Evidence (WOE), and Information Value (IV) for each level. The return data is already ranked by the IV values from high to low.

Examples

1
2
3
data <- rpart::stagec
st <- level.stat(data, x = c('eet', 'ploidy'), y = 'pgstat')
ggstat(st, theme = 'ws')

JianhuaHuang/streamlineR documentation built on Aug. 19, 2018, 6:59 a.m.