-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
README.Rmd
101 lines (70 loc) · 3.61 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#",
fig.path = "man/figures/README-",
out.width = "100%"
)
options(poorman.summarise.inform = FALSE)
```
<a name="readme-top"></a>
# {poorman} <a href='https://nathaneastwood.github.io/tags/poorman/'><img src='man/figures/logo.png' align="right" height="139" /></a>
[![CRAN status](https://www.r-pkg.org/badges/version/poorman)](https://cran.r-project.org/package=poorman)
[![Dependencies](https://tinyverse.netlify.com/badge/poorman)](https://cran.r-project.org/package=poorman)
![CRAN downloads](https://cranlogs.r-pkg.org/badges/poorman)
[![R-CMD-check](https://github.com/nathaneastwood/poorman/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/nathaneastwood/poorman/actions/workflows/check-standard.yaml)
[![codecov](https://codecov.io/gh/nathaneastwood/poorman/branch/master/graph/badge.svg?token=YPQSSEEHZJ)](https://app.codecov.io/gh/nathaneastwood/poorman)
<blockquote align="center">
I'd seen my father. He was a poor man, and I watched him do astonishing things.
- Sidney Poitier
</blockquote>
## Overview
{poorman} is a grammar of data manipulation, providing dependency free versions of [{dplyr}](https://github.com/tidyverse/dplyr) verbs that help you solve the most common data manipulation challenges:
* `select()` picks variables based on their names.
* `mutate()` adds new variables that are functions of existing variables.
* `filter()` picks cases based on their values.
* `summarise()` reduces multiple values down to a single summary.
* `arrange()` changes the ordering of the rows.
{poorman} attempts to replicate the {dplyr} API exactly such that your {dplyr} code will still run even if you use {poorman} in its place. In addition to replicating {dplyr} functionality, {poorman} implements other functionality from the wider {tidyverse} such as select helpers and the pipe, `%>%`.
For more details on the functionality available within {poorman}, check out the {poorman} series of blog posts [here](https://nathaneastwood.github.io/tags/poorman/).
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## Installation
You can install:
* the development version from [GitHub](https://github.com/nathaneastwood/poorman) with
```{r installation, eval = FALSE}
# install.packages("remotes")
remotes::install_github("nathaneastwood/poorman")
```
* the latest release from CRAN with
```{r cran, eval = FALSE}
install.packages("poorman")
```
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## Docker
If you'd like to try out the latest version of the package on CRAN using Docker, you can run the latest image with:
```{bash, eval = FALSE}
docker run --rm -it nathaneastwood/poorman
```
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## Usage
```{r usage}
library(poorman, warn.conflicts = FALSE)
mtcars %>%
select(mpg, wt, starts_with("c")) %>%
mutate(kpl = (1.609 * mpg) / 3.785, wt_kg = wt * 453.5924) %>%
filter(mpg > 28)
mtcars %>%
group_by(am, cyl) %>%
summarise(mean_mpg = mean(mpg), sd_mpg = sd(mpg)) %>%
ungroup()
```
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## Related Work
* [{dplyr}](https://github.com/tidyverse/dplyr)
* [{bplyr}](https://github.com/yonicd/bplyr) - imports {magrittr} and {rlang}; it prepends functions with `b_*()`, e.g. `b_select()`.
* [{tbltools}](https://github.com/mkearney/tbltools) - imports {magrittr} and appends `*_data()` to each of its functions, e.g. `select_data()`.
<p align="right">(<a href="#readme-top">back to top</a>)</p>