Skip to content

Commit

Permalink
Autogenerate the README (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrnold committed Feb 14, 2024
1 parent da80845 commit ca38c62
Show file tree
Hide file tree
Showing 19 changed files with 286 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ style:
.PHONY: lint
lint:
$(RSCRIPT) -e 'devtools::lint()'

README.md: README.Rmd
$(RSCRIPT) -e 'knitr::knit("$<", output = "$@", quiet = TRUE)'

138 changes: 138 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```

[![R-CMD-check](https://github.com/jrnold/ggthemes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jrnold/ggthemes/actions/workflows/R-CMD-check.yaml)
[![Code Coverage Status](https://codecov.io/gh/jrnold/ggthemes/branch/master/graph/badge.svg)](https://codecov.io/github/jrnold/ggthemes?branch=master)
[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/ggthemes)](https://github.com/metacran/cranlogs.app)
[![CRAN status](https://www.r-pkg.org/badges/version/ggthemes)](https://CRAN.R-project.org/package=ggthemes)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)

Some extra geoms, scales, and themes for
[ggplot](https://ggplot2.tidyverse.org/).

## Install

To install the stable version from CRAN,

```r
install.packages('ggthemes', dependencies = TRUE)
```

Or, to install the development version from github, use the
**devtools** package,

```r
library("devtools")
install_github(c("hadley/ggplot2", "jrnold/ggthemes"))
```

## How to use

For a quick tutorial, check out [Rafael Irizarry's book](https://rafalab.github.io/dsbook/ggplot2.html#add-on-packages).

## Examples

```{r}
library("ggplot2")
library("ggthemes")
mtcars2 <- within(mtcars, {
vs <- factor(vs, labels = c("V-shaped", "Straight"))
am <- factor(am, labels = c("Automatic", "Manual"))
cyl <- factor(cyl)
gear <- factor(gear)
})
p1 <- ggplot(mtcars2) +
geom_point(aes(x = wt, y = mpg, colour = gear)) +
labs(
title = "Fuel economy declines as weight increases",
subtitle = "(1973-74)",
caption = "Data from the 1974 Motor Trend US magazine.",
x = "Weight (1000 lbs)",
y = "Fuel economy (mpg)",
colour = "Gears"
)
```

```{r,theme_calc}
p1 +
scale_color_calc() +
theme_calc()
```

```{r,theme_clean}
p1 + theme_clean()
```

```{r,theme_economist}
p1 + theme_economist() +
scale_colour_economist()
```

```{r,theme_excel}
p1 + theme_excel() +
scale_colour_excel()
```

```{r,theme_excel_new}
p1 + theme_excel_new() +
scale_colour_excel_new()
```

```{r,theme_igray}
p1 + theme_igray()
```

```{r,theme_par}
p1 + theme_par()
```

```{r,theme_fivethirtyeight}
p1 + theme_fivethirtyeight()
```

```{r,theme_few}
p1 + theme_few() +
scale_colour_few()
```
```{r,theme_solarized}
p1 + theme_solarized() +
scale_colour_solarized()
```

```{r,theme_solarized_dark}
p1 + theme_solarized(light=FALSE) +
scale_colour_solarized()
```

```{r,theme_solid}
p1 + theme_solid()
```

```{r,theme_stata}
p1 + theme_tufte()
```

```{r,theme_wsj}
p1 + theme_wsj(base_size = 8) + scale_color_wsj()
```

```{r,scale_colorblind}
p1 + scale_color_colorblind()
```

```{r,scale_color_tableau}
p1 + scale_color_tableau()
```
152 changes: 144 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

[![R-CMD-check](https://github.com/jrnold/ggthemes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jrnold/ggthemes/actions/workflows/R-CMD-check.yaml)
[![Code Coverage Status](https://codecov.io/gh/jrnold/ggthemes/branch/master/graph/badge.svg)](https://codecov.io/github/jrnold/ggthemes?branch=master)
[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/ggthemes)](https://github.com/metacran/cranlogs.app)
[![CRAN status](https://www.r-pkg.org/badges/version/ggthemes)](https://CRAN.R-project.org/package=ggthemes)
[![Code Coverage
Status](https://codecov.io/gh/jrnold/ggthemes/branch/master/graph/badge.svg)](https://codecov.io/github/jrnold/ggthemes?branch=master)
[![rstudio mirror
downloads](http://cranlogs.r-pkg.org/badges/ggthemes)](https://github.com/metacran/cranlogs.app)
[![CRAN
status](https://www.r-pkg.org/badges/version/ggthemes)](https://CRAN.R-project.org/package=ggthemes)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)

Some extra geoms, scales, and themes for
Expand All @@ -11,18 +17,148 @@ Some extra geoms, scales, and themes for

To install the stable version from CRAN,

```r
``` r
install.packages('ggthemes', dependencies = TRUE)
```

Or, to install the development version from github, use the
**devtools** package,
Or, to install the development version from github, use the **devtools**
package,

```r
``` r
library("devtools")
install_github(c("hadley/ggplot2", "jrnold/ggthemes"))
```

## How to use

For a quick tutorial, check out [Rafael Irizarry's book](https://rafalab.github.io/dsbook/ggplot2.html#add-on-packages). For more examples [click here](https://github.com/BTJ01/ggthemes/tree/master/inst/examples).
For a quick tutorial, check out [Rafael Irizarry’s
book](https://rafalab.github.io/dsbook/ggplot2.html#add-on-packages).

## Examples

``` r
library("ggplot2")
library("ggthemes")

mtcars2 <- within(mtcars, {
vs <- factor(vs, labels = c("V-shaped", "Straight"))
am <- factor(am, labels = c("Automatic", "Manual"))
cyl <- factor(cyl)
gear <- factor(gear)
})

p1 <- ggplot(mtcars2) +
geom_point(aes(x = wt, y = mpg, colour = gear)) +
labs(
title = "Fuel economy declines as weight increases",
subtitle = "(1973-74)",
caption = "Data from the 1974 Motor Trend US magazine.",
x = "Weight (1000 lbs)",
y = "Fuel economy (mpg)",
colour = "Gears"
)
```

``` r
p1 +
scale_color_calc() +
theme_calc()
```

![](man/figures/README-theme_calc-1.png)<!-- -->

``` r
p1 + theme_clean()
```

![](man/figures/README-theme_clean-1.png)<!-- -->

``` r
p1 + theme_economist() +
scale_colour_economist()
```

![](man/figures/README-theme_economist-1.png)<!-- -->

``` r
p1 + theme_excel() +
scale_colour_excel()
```

![](man/figures/README-theme_excel-1.png)<!-- -->

``` r
p1 + theme_excel_new() +
scale_colour_excel_new()
```

![](man/figures/README-theme_excel_new-1.png)<!-- -->

``` r
p1 + theme_igray()
```

![](man/figures/README-theme_igray-1.png)<!-- -->

``` r
p1 + theme_par()
```

![](man/figures/README-theme_par-1.png)<!-- -->

``` r
p1 + theme_fivethirtyeight()
```

![](man/figures/README-theme_fivethirtyeight-1.png)<!-- -->

``` r
p1 + theme_few() +
scale_colour_few()
```

![](man/figures/README-theme_few-1.png)<!-- -->

``` r
p1 + theme_solarized() +
scale_colour_solarized()
```

![](man/figures/README-theme_solarized-1.png)<!-- -->

``` r
p1 + theme_solarized(light=FALSE) +
scale_colour_solarized()
```

![](man/figures/README-theme_solarized_dark-1.png)<!-- -->

``` r
p1 + theme_solid()
```

![](man/figures/README-theme_solid-1.png)<!-- -->

``` r
p1 + theme_tufte()
```

![](man/figures/README-theme_stata-1.png)<!-- -->

``` r
p1 + theme_wsj(base_size = 8) + scale_color_wsj()
```

![](man/figures/README-theme_wsj-1.png)<!-- -->

``` r
p1 + scale_color_colorblind()
```

![](man/figures/README-scale_colorblind-1.png)<!-- -->

``` r
p1 + scale_color_tableau()
```

![](man/figures/README-scale_color_tableau-1.png)<!-- -->
Binary file added man/figures/README-scale_color_tableau-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-scale_colorblind-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_calc-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_clean-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_economist-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_excel-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_excel_new-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_few-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_fivethirtyeight-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_igray-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_par-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_solarized-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_solarized_dark-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_solid-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_stata-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-theme_wsj-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca38c62

Please sign in to comment.