plotBar: Creates a bar plot of a categorical (discrete) feature.

Description Usage Arguments Value Examples

Description

Creates a bar plot of a categorical feature or all categorical features of a dataset .

Usage

1
2
plotBar(data, target, col = NULL, show.plot = FALSE, position = "dodge",
  ...)

Arguments

data

[data.frame]
Data.

target

[character(1)]
Target column. If no target is available in the dataset please insert NULL

col

[character(1) | integer(1)]
Selected feature from data. If all categorical features should be printed insert NULL. Default value is NULL

show.plot

[logical(1)]
Logical whether the ggplot(s) should be displayed or not when executing this function. Default is FALSE

position

[character(1)]
Position how to display the bar plot. Default is position = "dodge"

...

other arguments to be passed to geom_bar.

Value

A ggplot2 object. Print it to plot it. [WIP if col is null]

Examples

1
2
 data("Arthritis", package = "vcd")
 ggplot = plotBar(Arthritis, target = "Improved")

ptl93/AEDA documentation built on May 7, 2019, 3:20 p.m.