Learn R Programming

TRSbook (version 1.0.2)

barchart: Bar charts

Description

Pretty bar charts

Usage

barchart(x, col, my.title, pareto = FALSE, freq.cumul = FALSE, family = "Courier")

Arguments

x

qualitative variable

col

vector of characters for the color of each modality

my.title

character. Title of the plot

pareto

logical. TRUE for a Pareto diagram. Default os FALSE

freq.cumul

logical. TRUE to add a curve of cumulative frequencies. By default freq.cumul is FALSE

family

font family for the title. Default is "Courier". Another choice can be, e.g., "HersheyScript"

Value

A plot

References

Chapter 11 (Descriptive Statistics) from the book: The R Software, Fundamentals of Programming and Statistical Analysis

See Also

barplot

Examples

Run this code
# NOT RUN {
data(NUTRIELDERLY)
attach(NUTRIELDERLY)
fat <- as.factor(fat)
col <- c("yellow","yellow2","sandybrown","orange",
   "darkolivegreen","green","olivedrab2","green4")
barchart(fat,col,pareto=TRUE)
detach(NUTRIELDERLY)
# }

Run the code above in your browser using DataLab