Skip to content

Commit

Permalink
Mention the pipe more explicitly
Browse files Browse the repository at this point in the history
And switch to pak
  • Loading branch information
hadley committed Nov 25, 2024
1 parent 695d402 commit 12aed5c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
14 changes: 11 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/hadley/ggplot1/actions/workflows/R-CMD-check.yaml/badge.svghttps://github.com/hadley/ggplot1/actions/workflows/R-CMD-check.yaml/badge.svghttps://github.com/hadley/ggplot1/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/hadley/ggplot1/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

ggplot1 is an update of ggplot, the package that preceded ggplot2. ggplot1 is mostly made available out of historical interest, to illustrate how my thinking about API design in R has evolved over the years. I've made a few minor tweaks to the package, mostly fixing small things that obscure the interesting parts of the API.
ggplot1 is an update of ggplot, the package that preceded ggplot2. ggplot1 is mostly made available out of historical interest, to illustrate how my thinking about API design in R has evolved over the years. I've made a few minor tweaks to the package, mostly fixing small things that obscure the interesting parts of the API.
The most interesting thing about ggplot1 is that it was originally designed around the idea of function composition, so that you'd write code like this:

```{r}
#| eval: false
ggpoint(ggplot(mtcars, list(x = mpg, y = wt)))
```

I correct recognised that this was hard for people to read and write, but solved this problem in ggplot2 by overloading addition. In hindsight, this problem is solved generally by the pipe!

ggplot had 7 CRAN releases starting with 0.2.2 in April 2006, and finishing with 0.4.2 in October 2008.

Expand All @@ -28,8 +36,8 @@ ggplot had 7 CRAN releases starting with 0.2.2 in April 2006, and finishing with
You can install ggplot1 from github with:

```R
# install.packages("devtools")
devtools::install_github("hadley/ggplot1")
# install.packages("pak")
pak::pak("hadley/ggplot1")
```

## Usage
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ ggplot1 is an update of ggplot, the package that preceded ggplot2.
ggplot1 is mostly made available out of historical interest, to
illustrate how my thinking about API design in R has evolved over the
years. I’ve made a few minor tweaks to the package, mostly fixing small
things that obscure the interesting parts of the API.
things that obscure the interesting parts of the API. The most
interesting thing about ggplot1 is that it was originally designed
around the idea of function composition, so that you’d write code like
this:

``` r
ggpoint(ggplot(mtcars, list(x = mpg, y = wt)))
```

I correct recognised that this was hard for people to read and write,
but solved this problem in ggplot2 by overloading addition. In
hindsight, this problem is solved generally by the pipe!

ggplot had 7 CRAN releases starting with 0.2.2 in April 2006, and
finishing with 0.4.2 in October 2008.
Expand All @@ -22,8 +33,8 @@ finishing with 0.4.2 in October 2008.
You can install ggplot1 from github with:

``` r
# install.packages("devtools")
devtools::install_github("hadley/ggplot1")
# install.packages("pak")
pak::pak("hadley/ggplot1")
```

## Usage
Expand Down

0 comments on commit 12aed5c

Please sign in to comment.