-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathREADME.Rmd
53 lines (41 loc) · 1.16 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# tidylog
The goal of tidylog is to provide feedback about basic dplyr operations. It provides simple wrapper functions for the most common functions, such as `filter`, `mutate`, `select`, and `group_by`.
## Example
Load `tidylog` after `dplyr`:
```{r message=FALSE}
library("dplyr")
library("tidylog")
```
Tidylog will give you feedback, for instance when filtering a data frame:
```{r}
filtered <- filter(mtcars, cyl == 4)
```
This can be especially helpful in longer pipes:
```{r}
summary <- mtcars %>%
select(mpg, cyl, hp) %>%
filter(mpg > 15) %>%
mutate(mpg_round = round(mpg)) %>%
mutate(mpg_round = ifelse(mpg_round > 30, NA, mpg_round)) %>%
filter(!is.na(mpg_round)) %>%
group_by(cyl, mpg_round) %>%
tally() %>%
filter(n >= 1)
```
Here, it might have been accidental that the last `filter` command had no effect.
## Installation
``` r
devtools::install_github("elbersb/tidylog")
```