Learn R Programming

creditmodel (version 1.3.0)

plot_density: Plot Density

Description

You can use the plot_density to produce plots that characterize the density.

Usage

plot_density(
  dat,
  x,
  y = NULL,
  m = 3,
  g = 5,
  y_breaks = NULL,
  hist = 2,
  binwidth = NULL,
  pl_theme = plot_theme(legend.position = "top", title_size = 9, legend_size = 7,
    axis_title_size = 8),
  colors_y = c(love_color(type = "deep"), love_color(type = "light"), love_color(type =
    "shallow"))
)

Arguments

dat

A data.frame with independent variables and target variable.

x

The name of an independent variable.

y

The name of target variable.

m

The outlier cutoff.

g

Number of initial breakpoints for equal frequency binning.

y_breaks

Breaks points of y.

hist

If plot the histogram,-1,1,2, default is 2.

binwidth

Windth of bins for histogram.

pl_theme

Theme of plot

colors_y

colors of y.

Examples

Run this code
# NOT RUN {
plot_density(dat = lendingclub, x = "annual_inc",y = "emp_length", m =0, hist = -1)
plot_density(dat = lendingclub, x = "annual_inc", m = 2,
colors_y = love_color(type = "line")[c(1,3)])
# }

Run the code above in your browser using DataLab