barchart: Create a bar chart with labels

Description Usage Arguments Examples

View source: R/barchart.R

Description

This function allows you to create a bar chart and display the labels

Usage

1
barchart(df, x, y, label, x_label, y_label, title, vjust = 0.5, hjust = 0.5)

Arguments

df

A data frame with the observations

x

The name of the x-axis

y

The name of the y-axis

label

The labels to display

x_label

The label of the x-axis

y_label

The label of the y-axis

title

The title of the plot

vjust

To adjust vertically the labels

hjust

To adjust horizontally the labels

Examples

1
2
3
4
5
library(ggplot2)
df_gg <- count_percentage(iris, Species)
barchart(df = df_gg, x = Species, y = percentage, label = percentage,
x_label = "Species", y_label = "Percentage",
title = "Distribution of Species in Iris dataset", vjust = -0.25)

shezadt/utile documentation built on July 12, 2021, 10:54 a.m.