cheapr1.5.0 package

Simple Functions to Save Time and Memory

address

Memory address of R object

as_discrete

Turn continuous data into discrete bins

attrs

Add and remove attributes

bin

A sometimes cheaper but argument richer alternative to .bincode()

case

A cheapr case-when and switch

cast

Fast casting/coercing of R objects

cheapr_c

A cheapr version of c()

cheapr-package

cheapr: Simple Functions to Save Time and Memory

copy

Copy R objects

counts

Fast frequency tables - Still experimental

cpp_rebuild

Low-level attribute re-constructor

data_frame

Cheap data frame utilities

dots

Turn dot-dot-dot (...) into a named list

extras

Extra utilities

factors

A cheaper version of factor() along with cheaper utilities

gcd

Greatest common divisor and smallest common multiple

get_breaks

Pretty break-points for continuous (numeric) data

if_else

Cheaper version of ifelse()

int_sign

A fast and integer-based sign()

is_na

Efficient functions for dealing with missing values.

is_whole_number

Very fast check that numeric vector consists only of whole numbers

lag

Lagged operations.

lists

List utilities

math

Parallelised math operations

na_init

Fast NA initialisation

new_vector

Fast multi-threaded vector initialisation

overview

An alternative to summary() inspired by the skimr package

rebuild

Rebuild an object from a template

recycle

Recycle objects to a common size

rep

cheapr style repeat functions

replace

Fast vector replacement, an alternative to [<-

scalars

Efficient functions for counting, finding, replacing and removing scal...

sequences

Utilities for creating many sequences

set_math

Math operations by reference - Experimental

sset_df

Fast functions for data frame subsetting

sset

Cheaper subset sset()

str_coalesce

Coalesce character vectors

strings

Fast string concatenation using C++

switch_args

Switch between dot-dot-dot and a list of args

threads

Get and set the number of OpenMP threads to be used in cheapr

unique_

An alternative unique function

which_

Memory-efficient alternative to which()

Fast and memory-efficient (or 'cheap') tools to facilitate efficient programming, saving time and memory. It aims to provide 'cheaper' alternatives to common base R functions, as well as some additional functions.

  • Maintainer: Nick Christofides
  • License: MIT + file LICENSE
  • Last published: 2026-01-08