universe: Simple univariate plots.

Description Usage Arguments Details Value

View source: R/universe.R

Description

Bucket data and draw univariate plots in plotly. Univariate plots show the variation of one or more variable versus one covariate. universe will also draw a neat exposure histogram.

Usage

1
2
universe(input_df, plot_cols, by_col, buckets = 10, cut_type = "even",
  scale = "uniform", xtitle = by_col, ytitle = "", backend = "plotly")

Arguments

input_df

input data.frame or data.table

plot_cols

string vector naming one or more columns in input_df to plot against by_col

by_col

string naming the x-variable against which the plot_cols are measured

buckets

number of buckets into which to attempt to reduce the data. Defaults to 10.

cut_type

either "even" or "quantile". Defaults to "even".

  • "even" Cut data into evenly spaced buckets from the min to the max of by_col

  • "quantile" Cut data by quantile, in which each bucket will have approximately the same weight.

scale

either "uniform" or "cartesian". Defaults to "uniform".

  • "uniform" Distribute data buckets evenly. Represent weight with a bar chart.

  • "cartesian" Distribute data buckets according to the mean of their by_var. Represent weight with a histogram.

Details

Operates in two parts; bucketing the data into discrete bins (either evenly in by_col or evenly by quantile in by_col), then drawing the variation of the plot_cols vs by_col with a histogram of by_col's exposure.

Value

plotly object.


DexGroves/universe documentation built on May 6, 2019, 2:13 p.m.