densePlot: A function to display or save density plots created on all...

Description Usage Arguments Value Examples

View source: R/data_viz.R

Description

Creates (or saves as png if asked) density plots for all numeric features. Splits the density plots based on target feature categories.

Usage

1
densePlot(dataset, classVar, order = NULL, colors = NULL, loc = NULL)

Arguments

dataset

Name of the data frame object

classVar

Name of the target feature

order

A vector listing the target feature labels in the desired order. To use default order leave this parameter. Default value NULL.

colors

A vector listing which color to use to represent which target feature label. To have the function pick color leave this parameter. Deafult value NULL.

loc

A string with the directory where you want to save the plots. If no location is provided the plots will be created and displayed but not stored as image files.

Value

Returns three outputs:

  1. If loc = NULL, returns plots and displays in the RStudio Plots window,

  2. If loc has location provided, creates and saves the plots. Doesn't display in RStudio.

Examples

1
2
3
4
5
6
library(tidyverse)
densePlot(dataset = iris,
classVar = Species,
order = c("virginica", "versicolor", "setosa"),
colors = c("virginica" = "#32a897", "versicolor" = "#328bab", "setosa" = "#8031ad"),
loc = NULL)

Curious-Joe/mixBag documentation built on Aug. 30, 2021, 6:48 p.m.