Learn R Programming

BSDA (version 1.01)

Life: Life expectancy of men and women in U.S.

Description

Data for Exercise 1.31

Usage

Life

Arguments

Format

A data frame with 8 observations on the following 3 variables.

year

a numeric vector

Men

a numeric vector

Women

a numeric vector

Examples

Run this code
# NOT RUN {
str(Life)
attach(Life)
plot(year,Men,type="l",ylim=c(min(Men,Women),max(Men,Women)),col="blue",
main="Life Expectancy versus Year",ylab="Age",xlab="Year")
lines(year,Women,col="red")
text(1955,65,"Men",col="blue")
text(1955,70,"Women",col="red")
detach(Life)
# }

Run the code above in your browser using DataLab