Skip to content

Commit

Permalink
beautify tables
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Jul 28, 2024
1 parent 1c08fa6 commit c16abb7
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions vignettes/tidyverse_translation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ if (all_deps_available) {
can_vignette_be_evaluated <- all_deps_available && getRversion() >= "4.1.0"
# since we explicitly put `eval = TRUE` for some chunks, we can't rely on
# `knitr::opts_chunk$set(eval = FALSE)` at the beginning of the script. So we make
# a logical that is `FALSE` only if deps are not installed (cf easystats/easystats#317)
# Since we explicitly put `eval = TRUE` for some chunks, we can't rely on
# `knitr::opts_chunk$set(eval = FALSE)` at the beginning of the script.
# Therefore, we introduce a logical that is `FALSE` only if all suggested
# dependencies are not installed (cf easystats/easystats#317)
if (can_vignette_be_evaluated) {
evaluate_chunk <- TRUE
} else {
Expand Down Expand Up @@ -101,20 +102,20 @@ efc <- head(efc)
Before we look at their *tidyverse* equivalents, we can first have a look at
`{datawizard}`'s key functions for data wrangling:

| Function | Operation |
| :---------------- | :------------------------------------------------ |
| `data_filter()` | [to select only certain observations](#filtering) |
| `data_select()` | [to select only a few variables](#selecting) |
| `data_modify()` | [to create variables or modify existing ones](#modifying) |
| `data_arrange()` | [to sort observations](#sorting) |
| `data_extract()` | [to extract a single variable](#extracting) |
| `data_rename()` | [to rename variables](#renaming) |
| `data_relocate()` | [to reorder a data frame](#relocating) |
| `data_to_long()` | [to convert data from wide to long](#reshaping) |
| `data_to_wide()` | [to convert data from long to wide](#reshaping) |
| `data_join()` | [to join two data frames](#joining) |
| `data_unite()` | [to concatenate several columns into a single one](#uniting) |
| `data_separate()` | [to separate a single column into multiple columns](#separating) |
| Function | Operation |
| :---------------- | :--------------------------------------------------------------- |
| `data_filter()` | [to select only certain observations](#filtering) |
| `data_select()` | [to select only a few variables](#selecting) |
| `data_modify()` | [to create variables or modify existing ones](#modifying) |
| `data_arrange()` | [to sort observations](#sorting) |
| `data_extract()` | [to extract a single variable](#extracting) |
| `data_rename()` | [to rename variables](#renaming) |
| `data_relocate()` | [to reorder a data frame](#relocating) |
| `data_to_long()` | [to convert data from wide to long](#reshaping) |
| `data_to_wide()` | [to convert data from long to wide](#reshaping) |
| `data_join()` | [to join two data frames](#joining) |
| `data_unite()` | [to concatenate several columns into a single one](#uniting) |
| `data_separate()` | [to separate a single column into multiple columns](#separating) |

Note that there are a few functions in `{datawizard}` that have no strict equivalent
in `{dplyr}` or `{tidyr}` (e.g `data_rotate()`), and so we won't discuss them in
Expand All @@ -128,7 +129,7 @@ Before we look at them individually, let's first have a look at the summary tabl
| :---------------- | :------------------------------------------------------------------ |
| `data_filter()` | `dplyr::filter()`, `dplyr::slice()` |
| `data_select()` | `dplyr::select()` |
| `data_modify()` | `dplyr::mutate()` |
| `data_modify()` | `dplyr::mutate()` |
| `data_arrange()` | `dplyr::arrange()` |
| `data_extract()` | `dplyr::pull()` |
| `data_rename()` | `dplyr::rename()` |
Expand All @@ -138,8 +139,8 @@ Before we look at them individually, let's first have a look at the summary tabl
| `data_join()` | `dplyr::inner_join()`, `dplyr::left_join()`, `dplyr::right_join()`, |
| | `dplyr::full_join()`, `dplyr::anti_join()`, `dplyr::semi_join()` |
| `data_peek()` | `dplyr::glimpse()` |
| `data_unite()` | `tidyr::unite()` |
| `data_separate()` | `tidyr::separate()` |
| `data_unite()` | `tidyr::unite()` |
| `data_separate()` | `tidyr::separate()` |

## Filtering {#filtering}

Expand Down

0 comments on commit c16abb7

Please sign in to comment.