Learn R Programming

vannstats (version 1.5.4.07)

bar.chart: Simplified Bar Chart

Description

This function plots a bar chart (bar.chart) on a given data frame.

Usage

bar.chart(df, var1, lab = FALSE)

Value

This function returns the bar chart for var1 in data frame df.

Arguments

df

data frame to read in.

var1

the dependent/outcome variable, \(Y\). The variable of interest that should be plotted.

lab

logical (default set to FALSE). When set to lab = TRUE, will add frequency label for each bar in chart.

Examples

Run this code
data <- mtcars

bar.chart(data,cyl)

Run the code above in your browser using DataLab