Last data update: 2014.03.03

R: Data sets and supplements (OpenIntro)
OIdata-packageR Documentation

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.

Details

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

Author(s)

Andrew P Bray and David M Diez

Maintainer: Andrew P Bray <andrew@openintro.org>

References

OpenIntro openintro.org

Examples

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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(OIdata)
Loading required package: RCurl
Loading required package: bitops
Loading required package: maps

 # maps v3.1: updated 'world': all lakes moved to separate new #
 # 'lakes' database. Type '?world' or 'news(package="maps")'.  #


> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/OIdata/OIdata-package.Rd_%03d_medium.png", width=480, height=480)
> ### Name: OIdata-package
> ### Title: Data sets and supplements (OpenIntro)
> ### Aliases: OIdata-package OIdata
> ### Keywords: package
> 
> ### ** Examples
> 
> data(military)
> (tabFM <- table(military$branch, military$gender) /
+           matrix(rep(table(military$branch), 2), ncol = 2))
              
                   female       male
  air force    0.19367334 0.80632666
  army         0.13464988 0.86535012
  marine corps 0.06503552 0.93496448
  navy         0.15564060 0.84435940
> 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)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>