Learn R Programming

TRSbook (version 1.0.2)

crosschart: A cross chart

Description

A cross chart displays for each observation a smal cross above the associated modality

Usage

crosschart(x, my.title, col,family="Courier")

Arguments

x

qualitative variable

my.title

character. title of the plot

col

vector of characters for the color of each modality

family

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

Value

A cross chart

References

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

Examples

Run this code
# NOT RUN {
data(NUTRIELDERLY)
attach(NUTRIELDERLY)
situation <- as.factor(situation)
levels(situation) <- c("single","couple","family","other")
crosschart(situation,col=c("orange","darkgreen","black","tan"))
detach(NUTRIELDERLY)
# }

Run the code above in your browser using DataLab