Learn R Programming

OIdata (version 1.0)

OIdata-package: Data sets and supplements (OpenIntro)

Description

A collection of data sets from several sources that may be useful for teaching, practice, or other purposes. Functions have also been included to assist in the retrieval of table data from websites or in visualizing sample data.

Arguments

Details

Package:
OIdata
Type:
Package
Version:
1.0
Date:
2011-11-03
License:
GPL-2 | GPL-3
LazyLoad:
yes

References

OpenIntro openintro.org

Examples

Run this code
data(military)
(tabFM <- table(military$branch, military$gender) /
          matrix(rep(table(military$branch), 2), ncol = 2))
barplot(tabFM[,1], main = "proportion female")

data(piracy)
pipa     <- piracy[piracy$chamber == "senate",]
keep     <- pipa$money_pro > 0 & pipa$money_con > 0
for_pipa <- pipa$stance[keep] == "yes"
col      <- ifelse(for_pipa, 2, 1)
pch      <- ifelse(for_pipa, 20, 1)
plot(pipa$money_pro[keep], pipa$money_con[keep],
     log="xy", col=col, pch=pch)

Run the code above in your browser using DataLab