---
title: "R Notebook"
output: html_notebook
---

```{r}
#par(pin=c(3,2))
pdf('/Users/mcmcclur/Documents/html/classes/Fall2017Stat185/ProblemSheets/p1.pdf')
par(mfrow=c(1,2))
d = c(10,20,21,14,18)
pie(d, labels=c(59,84,27,32,8))
barplot(d, names=c(59,84,27,32,8), asp=1/3)
dev.off()
```

```{r}
#par(pin=c(3,2))
pdf('/Users/mcmcclur/Documents/html/classes/Fall2017Stat185/ProblemSheets/p2_2.pdf')
par(mfrow=c(2,2))
set.seed(2)
d = rnorm(1000)
d2 = rexp(1000)
hist(c(d-2,d+3), col='gray', main='(a)', xlab='',ylab='')
hist(d2, col='gray', main='(b)', xlab='',ylab='')
hist(d, col='gray', main='(c)', xlab='',ylab='')
hist(c(d2, d+5), col='gray', main='(d)', xlab='',ylab='')
dev.off()
```

```{r}
#par(pin=c(3,0.2))
#par(mar=c(0.1,0.5,0.1,0.5))
pdf('/Users/mcmcclur/Documents/html/classes/Fall2017Stat185/ProblemSheets/p2_1.pdf', width=5, height=3)
set.seed(2); d = round(20*runif(121)+30)
boxplot(d, horizontal = T)
dev.off()
```