Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathaneastwood/poorman
A poor man's dependency free grammar of data manipulation
https://github.com/nathaneastwood/poorman
base-r data-manipulation grammar r
Last synced: about 2 months ago
JSON representation
A poor man's dependency free grammar of data manipulation
- Host: GitHub
- URL: https://github.com/nathaneastwood/poorman
- Owner: nathaneastwood
- License: other
- Created: 2020-02-15T13:24:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-08T13:41:42.000Z (11 months ago)
- Last Synced: 2024-10-28T17:24:31.661Z (3 months ago)
- Topics: base-r, data-manipulation, grammar, r
- Language: R
- Homepage: https://nathaneastwood.github.io/poorman/
- Size: 6.59 MB
- Stars: 340
- Watchers: 9
- Forks: 15
- Open Issues: 21
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - nathaneastwood/poorman - A poor man's dependency free grammar of data manipulation (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#",
fig.path = "man/figures/README-",
out.width = "100%"
)
options(poorman.summarise.inform = FALSE)
```[![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)
I'd seen my father. He was a poor man, and I watched him do astonishing things.
- Sidney Poitier## 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/).
## 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")
```## 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
```## 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()
```## 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()`.