MyNixOS website logo
Description

A Poor Man's Dependency Free Recreation of 'dplyr'.

A replication of key functionality from 'dplyr' and the wider 'tidyverse' using only 'base'.

{poorman}

CRANstatus Dependencies CRAN downloads R-CMD-check codecov

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} 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.

(back to top)

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")

(back to top)

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

(back to top)

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

(back to top)

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().

(back to top)

Metadata

Version

0.2.7

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows