Learn R Programming

{poorman}

Overview

{poorman} is a grammar of data manipulation, providing dependency free versions of {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.

Installation

You can install:

  • the development version from GitHub with
# install.packages("remotes")
remotes::install_github("nathaneastwood/poorman")
  • the latest release from CRAN with
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:

docker run --rm -it nathaneastwood/poorman

Usage

library(poorman, warn.conflicts = FALSE)
# 
#   I'd seen my father. He was a poor man, and I watched him do astonishing things.
#     - Sidney Poitier

mtcars %>%
  select(mpg, wt, starts_with("c")) %>%
  mutate(kpl = (1.609 * mpg) / 3.785, wt_kg = wt * 453.5924) %>%
  filter(mpg > 28)
#                 mpg    wt cyl carb      kpl    wt_kg
# Fiat 128       32.4 2.200   4    1 13.77321 997.9033
# Honda Civic    30.4 1.615   4    2 12.92301 732.5517
# Toyota Corolla 33.9 1.835   4    1 14.41086 832.3421
# Lotus Europa   30.4 1.513   4    2 12.92301 686.2853

mtcars %>%
  group_by(am, cyl) %>%
  summarise(mean_mpg = mean(mpg), sd_mpg = sd(mpg)) %>%
  ungroup()
#   am cyl mean_mpg    sd_mpg
# 1  0   4 22.90000 1.4525839
# 2  0   6 19.12500 1.6317169
# 3  0   8 15.05000 2.7743959
# 4  1   4 28.07500 4.4838599
# 5  1   6 20.56667 0.7505553
# 6  1   8 15.40000 0.5656854

Related Work

  • {dplyr}
  • {bplyr} - imports {magrittr} and {rlang}; it prepends functions with b_*(), e.g. b_select().
  • {tbltools} - imports {magrittr} and appends *_data() to each of its functions, e.g. select_data().

Copy Link

Version

Install

install.packages('poorman')

Monthly Downloads

7,578

Version

0.2.8

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Nathan Eastwood

Last Published

July 31st, 2026

Functions in poorman (0.2.8)

glimpse

Get a glimpse of your data
fill

Fill in missing values with previous or next value
filter

Return rows with matching conditions
filter_joins

Filtering joins filter rows from x based on the presence or absence of matches in y:
group_by

Group by one or more variables
group_metadata

Grouping metadata
distinct

Subset distinct/unique rows
group_cols

Select Grouping Variables
group_by_drop_default

Default value for .drop argument of group_by
group_split

Split data.frame by groups
nth

Extract the first, last or nth value from a vector
if_else

Vectorised if
lst

Build a list
n_distinct

Count the number of unique values in a set of vectors
lag

Compute lagged or leading values
na_if

Convert values to NA
nest_by

Nest By
mutate_joins

Mutating Joins
mutate

Create or transform variables
near

Compare two numeric vectors
pivot_wider

Pivot data from long to wide
pivot_longer

Pivot data from wide to long
pipe

Forward-pipe operator
relocate

Change column order
recode

Recode values
replace_na

Replace missing values
rename

Rename columns
poorman

poorman: A Poor Man's Dependency Free Recreation of 'dplyr'
pull

Pull out a single variable
peek_vars

Peek at variables in the selection context
unite

Unite Multiple Columns Into One
select_helpers

Select Helpers
select

Subset columns using their names and types
where

Select variables with a function
rownames

Tools for working with row names
with_groups

Perform an operation with temporary groups
window_rank

Windowed Rank Functions
summarise

Reduce multiple values down to a single value
union_all

Union All
slice

Subset rows by position
arrange

Arrange rows by variables
case_when

A General Vetorised if()
coalesce

Find first non-missing element
cummean

Cumulative versions of any, all, and mean
desc

Descending order
between

Do values in a numeric vector fall in specified range?
context

Context dependent expressions
across

Apply a function (or functions) across multiple columns
count

Count observations by group
bind

Efficiently bind multiple data.frames by row and column