bar_plot {AnalysisLin}R Documentation

Bar Plots for Categorical Variables

Description

This function generates bar plots for all categorical variables in the input data frame. Bar plots offer a visual representation of the distribution of categorical variables, making it easy to understand the frequency of each category. They are particularly useful for exploring patterns, identifying dominant categories, and comparing the relative frequencies of different levels within each variable.

Usage

bar_plot(
  data,
  fill = "skyblue",
  color = "black",
  width = 0.7,
  subplot = FALSE,
  nrow = 2,
  margin = 0.1,
  html = FALSE
)

Arguments

data

The input data frame containing categorical variables.

fill

Fill color for the bars (default: "skyblue").

color

Border color of the bars (default: "black").

width

Width of the bars (default: 0.7).

subplot

A logical argument (default: FALSE) indicating whether to create subplots.

nrow

Number of rows for subplots (if subplot is TRUE, default: 2).

margin

Margin for subplots (if subplot is TRUE, default: 0.1).

html

Whether the output should be in HTML format,used when knitting into HTML. Default is FALSE.

Value

A list of bar plots.

Examples

data(iris)
bar_plot(iris)


[Package AnalysisLin version 0.1.2 Index]