Skip to content

Vectorised Nested if-else Statements Similar to CASE WHEN in 'SQL'

0packages depend
2.8Kdownloads / year
90.6%test coverage
13/13flavors OK

Overview

About

Functions for vectorised conditional recoding of variables. case_when() enables you to vectorise multiple if and else statements (like 'CASE WHEN' in 'SQL'). if_else() is a stricter and more predictable version of ifelse() in 'base' that preserves attributes. These functions are forked from 'dplyr' with all package dependencies removed and behave identically to the originals.

Changes in 1.1.0
  • Added exceeds_tumbling_sum() for checking when a partial cumulative sum

("tumbling sum"") hits a certain threshold value. This is for example useful

for filtering geographic positions by a minimum distance. Thanks to

@klmr for helping me come up with a name.

  • Added plain C clones of dplyr::cumall() and dplyr::cumany()

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 1.9 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK12 OK2026-04-25
  • NOTE11 OK, 3 NOTE2026-03-10
Advisories

none known

Documentation

In release 1.1.0
READMEYes · 163 wordsVignettesNoNEWSYes · 100% structured · mentions 1.1.0Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
5 (1 internal)includes a package overview page
Examples that run
100%4 run in a plain check
Exported functions with examples
100%
Documented parameters
83%
Return-value docs
100%
Help pages citing references
0%

Downloads

2.8K
CRAN downloads in the past year
Rank #16,957 · ~8/day · ~234/mo
Daily download trend is not available in this view yet.
32930 days
74790 days
2.8K1 year
Compare downloads with other packages →
Also on347 r2u3 autocran

Dependencies

Declared dependencies
1 external dependency (excludes base and recommended)

Installing lest adds no packages beyond those that come with R.

Depends (0)
none
Imports (0)
none
LinkingTo (0)
none
Suggests (1)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (5)
Author, Maintainer since 1.0.0 (2018)
Author · added in 1.1.0
Author · added in 1.1.0
Author · added in 1.1.0
Author · added in 1.1.0
Releases (2)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • 1.1.0Latest
    record
    2019-11-29 · current release · diff ↗ ·
    added 3 exports
    cumall, cumany, exceeds_tumbling_sum
  • R
    R 3.6.0 released · 2019-04-26
  • 1.0.0
    record
    2018-08-16
  • R
    R 3.5.0 released · 2018-04-23

Package metadata

First published
2018-08-16
Total releases
2 / 8 yrs
License
MIT + file LICENSE OSI
Download size
15 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("lest")
Fleck, S., François, R., Henry, L., Müller, K., & Wickham, H. (2019). lest: Vectorised Nested if-else Statements Similar to CASE WHEN in 'SQL' (Version 1.1.0) [Computer software]. https://doi.org/10.32614/CRAN.package.lest

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for lest version 1.1.0 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy