Skip to content

Commit

Permalink
Improve website navbar + article index (tidyverse#5081)
Browse files Browse the repository at this point in the history
* Remove navbar customisations. In favour of new `news.release` config

* Organise articles index and add article descriptions
  • Loading branch information
hadley committed Apr 2, 2020
1 parent 0f7b6ab commit affb977
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 55 deletions.
76 changes: 38 additions & 38 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,45 +113,45 @@ reference:
- all_vars
- vars

articles:
- title: Get started
navbar: ~
contents:
- dplyr
- grouping
- two-table
- base

- title: Automate
navbar: Automation
contents:
- colwise
- rowwise
- programming

- title: Other
contents:
- window-functions
- compatibility

news:
releases:
- text: "Version 0.8.4"
href: https://www.tidyverse.org/articles/2019/10/dplyr-0-8-4/
- text: "Version 0.8.3"
href: https://www.tidyverse.org/articles/2019/07/dplyr-0-8-3/
- text: "Version 0.8.2"
href: https://www.tidyverse.org/articles/2019/06/dplyr-0-8-2/
- text: "Version 0.8.1"
href: https://www.tidyverse.org/articles/2019/05/dplyr-0-8-1/
- text: "Version 0.8.0"
href: https://www.tidyverse.org/articles/2019/02/dplyr-0-8-0/
- text: "Version 0.7.5"
href: https://www.tidyverse.org/articles/2018/06/dplyr-0.7.5/

navbar:
type: default
left:
- text: Intro
href: articles/dplyr.html
- text: Reference
href: reference/index.html
- text: Articles
menu:
- text: Two-table verbs
href: articles/two-table.html
- text: Window functions
href: articles/window-functions.html
- text: Databases with dbplyr
href: http://dbplyr.tidyverse.org/articles/dbplyr.html
- text: Programming with dplyr
href: articles/programming.html
- text: Compatibility
href: articles/compatibility.html
- text: News
menu:
- text: "Release notes"
- text: "Version 0.8.4"
href: https://www.tidyverse.org/articles/2019/10/dplyr-0-8-4/
- text: "Version 0.8.3"
href: https://www.tidyverse.org/articles/2019/07/dplyr-0-8-3/
- text: "Version 0.8.2"
href: https://www.tidyverse.org/articles/2019/06/dplyr-0-8-2/
- text: "Version 0.8.1"
href: https://www.tidyverse.org/articles/2019/05/dplyr-0-8-1/
- text: "Version 0.8.0"
href: https://www.tidyverse.org/articles/2019/02/dplyr-0-8-0/
- text: "Version 0.7.5"
href: https://www.tidyverse.org/articles/2018/06/dplyr-0.7.5/
- text: "Change log"
href: news/index.html
right:
- icon: fa-github fa-lg
href: https://github.com/tidyverse/dplyr
components:
home: ~

development:
mode: auto
Expand Down
4 changes: 4 additions & 0 deletions vignettes/base.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
title: "dplyr <-> base R"
output: rmarkdown::html_vignette
description: >
How does dplyr compare to base R? This vignette describes the main differences
in philosophy, and shows the base R code most closely equivalent to each
dplyr verb.
vignette: >
%\VignetteIndexEntry{From base R to dplyr}
%\VignetteEngine{knitr::rmarkdown}
Expand Down
3 changes: 3 additions & 0 deletions vignettes/colwise.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: "colwise operations"
description: >
Learn how to easily repeat the same operation across multiple
columns using `across()`.
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{colwise}
Expand Down
3 changes: 3 additions & 0 deletions vignettes/compatibility.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: "dplyr compatibility"
description: >
A guide for package authors who need to work with multiple versions
of dplyr.
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{dplyr compatibility}
Expand Down
37 changes: 20 additions & 17 deletions vignettes/dplyr.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
title: "Introduction to dplyr"
output: rmarkdown::html_vignette
description: >
Start here if this is your first time using dplyr. You'll learn the basic
philosophy, the most important data manipulation verbs, and the pipe, `%>%`,
which allows you to combine multiple verbs together to solve real problems.
vignette: >
%\VignetteIndexEntry{Introduction to dplyr}
%\VignetteEngine{knitr::rmarkdown}
Expand Down Expand Up @@ -34,8 +38,6 @@ The dplyr package makes these steps fast and easy:

This document introduces you to dplyr's basic set of tools, and shows you how to apply them to data frames. dplyr also supports databases via the dbplyr package, once you've installed, read `vignette("dbplyr")` to learn more.

All of the dplyr functions take a data frame (or tibble) as the first argument. Rather than forcing the user to either save intermediate objects or nest functions, dplyr provides the `%>%` operator from magrittr. `x %>% f(y)` turns into `f(x, y)` so the result from one step is then "piped" into the next step. You can use the pipe to rewrite multiple operations that you can read left-to-right, top-to-bottom (reading the pipe operator as "then").

## Data: starwars

To explore the basic data manipulation verbs of dplyr, we'll use the dataset `starwars`. This dataset contains `r nrow(starwars)` characters and comes from the [Star Wars API](http://swapi.co), and is documented in `?starwars`
Expand All @@ -49,25 +51,26 @@ Note that `starwars` is a tibble, a modern reimagining of the data frame. It's p

## Single table verbs

dplyr aims to provide a function for each basic verb of data manipulation.
dplyr aims to provide a function for each basic verb of data manipulation. These verbs can be organised into three categories based on the component of the dataset that they work with:

* row operations:

* `filter()` to choose cases based on their values.
* `arrange()` to reorder the cases.
* `slice()` to choose cases based on their position.
* Rows:
* `filter()` chooses rows based on column values.
* `slice()` chooses rows based on location.
* `arrange()` changes the order of the rows.

* column operations:

* `select()` and `rename()` to select variables based on their names.
* `mutate()` and `transmute()` to add new variables that are functions of existing variables.
* `relocate()` to change the order of the variables.

* Columns:
* `select()` changes whether or not a column is included.
* `rename()` changes the name of columns.
* `mutate()` changes the values of columns and creates new columns.
* `relocate()` changes the order of the columns.

* Groups of rows:
* `summarise()` collapses a group into a single row.

### The pipe

* summarize operation:
All of the dplyr functions take a data frame (or tibble) as the first argument. Rather than forcing the user to either save intermediate objects or nest functions, dplyr provides the `%>%` operator from magrittr. `x %>% f(y)` turns into `f(x, y)` so the result from one step is then "piped" into the next step. You can use the pipe to rewrite multiple operations that you can read left-to-right, top-to-bottom (reading the pipe operator as "then").

* `summarise()` to condense multiple values to a single value.

### Filter rows with `filter()`

`filter()` allows you to select a subset of rows in a data frame. Like all single verbs, the first argument is the tibble (or data frame). The second and subsequent arguments refer to variables within that data frame, selecting rows where the expression is `TRUE`.
Expand Down
5 changes: 5 additions & 0 deletions vignettes/grouping.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
title: "Grouped data"
description: >
To unlock the full potential of dplyr, you need to understand how each verb
interacts with grouping. This vignette shows you how to manipulate grouping,
how each verb changes its behaviour when working with grouped data, and
how you can access data about the "current" group from within a verb.
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Grouped data}
Expand Down
5 changes: 5 additions & 0 deletions vignettes/programming.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
title: "Programming with dplyr"
description: >
Most dplyr verbs use "tidy evaluation", a special type of non-standard
evaluation. In this vignette, you'll learn the two basic forms, data masking
and tidy selection, and how you can program with them using either functions
or for loops.
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Programming with dplyr}
Expand Down
5 changes: 5 additions & 0 deletions vignettes/rowwise.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
title: "rowwise operations"
description: >
In R, it's usually easier to do something for each column than for each row.
In this vignette you will learn how to use the `rowwise()` function to
perform operations by row. Along the way, you'll learn about list-columns,
and see how you might perform simulations and modelling within dplyr verbs.
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{rowwise}
Expand Down
5 changes: 5 additions & 0 deletions vignettes/two-table.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
title: "Two-table verbs"
description: >
Most dplyr verbs work with a single data set, but most data analyses involve
multiple datasets. This vignette introduces you to the dplyr verbs that
work with more one than data set, and introduces to the mutating joins,
filtering joins, and the set operations.
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Two-table verbs}
Expand Down
4 changes: 4 additions & 0 deletions vignettes/window-functions.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
title: "Window functions"
description: >
Window functions are a useful family of functions that work with vectors
(returning an output the same size as the input), and combine naturally
with `mutate()` and `filter()`.
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Window functions}
Expand Down

0 comments on commit affb977

Please sign in to comment.