Browse Source

Cleaned up figures in README

pull/25/head
Bob Rudis 9 years ago
parent
commit
624018ce2e
  1. 51
      README.Rmd
  2. 164
      README.html
  3. 28
      README.md
  4. BIN
      README_files/figure-markdown_github/f5-1.png
  5. 0
      README_files/figure-markdown_github/fig1-1.png
  6. BIN
      README_files/figure-markdown_github/fig2-1.png
  7. BIN
      README_files/figure-markdown_github/fig3-1.png
  8. BIN
      README_files/figure-markdown_github/fig4a-1.png
  9. BIN
      README_files/figure-markdown_github/unnamed-chunk-10-1.png
  10. BIN
      README_files/figure-markdown_github/unnamed-chunk-6-1.png
  11. BIN
      README_files/figure-markdown_github/unnamed-chunk-9-1.png

51
README.Rmd

@ -27,53 +27,59 @@ The following functions are implemented:
### Installation
```{r eval=FALSE}
```{r s1, eval=FALSE}
devtools::install_github("timelyportfolio/rcdimple") # only for htmlwidget functionality
devtools::install_github("hrbrmstr/waffle")
```
```{r echo=FALSE, message=FALSE, warning=FALSE, error=FALSE}
```{r s2, echo=FALSE, message=FALSE, warning=FALSE, error=FALSE}
options(width=120)
```
### Usage
```{r}
```{r s3}
library(waffle)
# current verison
packageVersion("waffle")
# basic example
parts <- c(80, 30, 20, 10)
```
```{r fig.width=6, fig.height=2.5}
```{r fig1, fig.width=6, fig.height=2.5}
waffle(parts, rows=8)
```
```{r}
```{r s4}
# slightly more complex example
parts <- c(`Un-breached\nUS Population`=(318-11-79), `Premera`=11, `Anthem`=79)
```
```{r t1, eval=FALSE}
waffle(parts, rows=8, size=1, colors=c("#969696", "#1879bf", "#009bda"))
```
**Health records breaches as fraction of US Population**
```{r fig.width=6, fig.height=2.5}
```{r fig2, echo= FALSE, fig.width=6, fig.height=1.75}
waffle(parts, rows=8, size=1, colors=c("#969696", "#1879bf", "#009bda"))
```
<smaller>One square == 1m ppl</smaller>
**Health records breaches as a fraction os US popualation**
```{r fig.width=6, fig.height=2.5}
```{r t2, eval=FALSE}
waffle(parts/10, rows=3, colors=c("#969696", "#1879bf", "#009bda"))
```
**Health records breaches as fraction of US Population**
```{r fig3, echo=FALSE, fig.width=6, fig.height=2}
waffle(parts/10, rows=3, colors=c("#969696", "#1879bf", "#009bda"))
```
<smaller>(One square == 10m ppl)</smaller>
```{r}
```{r s5}
# replicating an old favourite
# http://graphics8.nytimes.com/images/2008/07/20/business/20debtgraphic.jpg
@ -82,21 +88,36 @@ savings <- c(`Mortgage ($84,911)`=84911, `Auto and\ntuition loans ($14,414)`=144
`Home equity loans ($10,062)`=10062, `Credit Cards ($8,565)`=8565)
```
```{r fig4, eval=FALSE}
waffle(savings/392, rows=7, size=0.5,
colors=c("#c7d4b6", "#a3aabd", "#a0d0de", "#97b5cf"))
```
*Average Household Savings Each Year**
```{r fig.width=8, fig.height=3}
```{r fig4a, echo=FALSE, fig.width=8, fig.height=2}
waffle(savings/392, rows=7, size=0.5,
colors=c("#c7d4b6", "#a3aabd", "#a0d0de", "#97b5cf"))
```
<smaller> (1 square == $392)</smaller>
```{r fig.height=3, fig.width=3}
```{r s6}
# similar to but not exact
# https://eagereyes.org/techniques/square-pie-charts
professional <- c(`Male`=44, `Female (56%)`=56)
waffle(professional, rows=10, size=0.5, colors=c("#af9139", "#544616"),
title="Professional Workforce Makeup")
```
```{r t5, eval=FALSE}
waffle(professional, rows=10, size=0.5, colors=c("#af9139", "#544616"))
```
**Professional Workforce Makeup**
```{r f5, echo=FALSE, fig.height=3, fig.width=4}
waffle(professional, rows=10, size=0.5, colors=c("#af9139", "#544616"))
```
### Test Results

164
README.html

File diff suppressed because one or more lines are too long

28
README.md

@ -40,7 +40,6 @@ packageVersion("waffle")
``` r
# basic example
parts <- c(80, 30, 20, 10)
```
@ -48,31 +47,26 @@ parts <- c(80, 30, 20, 10)
waffle(parts, rows=8)
```
![](README_files/figure-markdown_github/unnamed-chunk-4-1.png)
![](README_files/figure-markdown_github/fig1-1.png)
``` r
# slightly more complex example
parts <- c(`Un-breached\nUS Population`=(318-11-79), `Premera`=11, `Anthem`=79)
```
**Health records breaches as fraction of US Population**
``` r
waffle(parts, rows=8, size=1, colors=c("#969696", "#1879bf", "#009bda"))
```
![](README_files/figure-markdown_github/unnamed-chunk-6-1.png)
**Health records breaches as fraction of US Population** ![](README_files/figure-markdown_github/fig2-1.png)
<smaller>One square == 1m ppl</smaller>
**Health records breaches as a fraction os US popualation**
``` r
waffle(parts/10, rows=3, colors=c("#969696", "#1879bf", "#009bda"))
```
![](README_files/figure-markdown_github/unnamed-chunk-7-1.png)
**Health records breaches as fraction of US Population** ![](README_files/figure-markdown_github/fig3-1.png)
<smaller>(One square == 10m ppl)</smaller>
@ -85,14 +79,12 @@ savings <- c(`Mortgage ($84,911)`=84911, `Auto and\ntuition loans ($14,414)`=144
`Home equity loans ($10,062)`=10062, `Credit Cards ($8,565)`=8565)
```
\*Average Household Savings Each Year\*\*
``` r
waffle(savings/392, rows=7, size=0.5,
colors=c("#c7d4b6", "#a3aabd", "#a0d0de", "#97b5cf"))
```
![](README_files/figure-markdown_github/unnamed-chunk-9-1.png)
\*Average Household Savings Each Year\*\* ![](README_files/figure-markdown_github/fig4a-1.png)
<smaller> (1 square == $392)</smaller>
@ -101,11 +93,15 @@ waffle(savings/392, rows=7, size=0.5,
# https://eagereyes.org/techniques/square-pie-charts
professional <- c(`Male`=44, `Female (56%)`=56)
waffle(professional, rows=10, size=0.5, colors=c("#af9139", "#544616"),
title="Professional Workforce Makeup")
```
![](README_files/figure-markdown_github/unnamed-chunk-10-1.png)
``` r
waffle(professional, rows=10, size=0.5, colors=c("#af9139", "#544616"))
```
**Professional Workforce Makeup**
![](README_files/figure-markdown_github/f5-1.png)
### Test Results
@ -116,7 +112,7 @@ library(testthat)
date()
```
## [1] "Thu Mar 19 11:34:47 2015"
## [1] "Thu Mar 19 11:44:29 2015"
``` r
test_dir("tests/")

BIN
README_files/figure-markdown_github/f5-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

0
README_files/figure-markdown_github/unnamed-chunk-4-1.png → README_files/figure-markdown_github/fig1-1.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
README_files/figure-markdown_github/fig2-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-7-1.png → README_files/figure-markdown_github/fig3-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
README_files/figure-markdown_github/fig4a-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-10-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-6-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
README_files/figure-markdown_github/unnamed-chunk-9-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Loading…
Cancel
Save