R Observatory
Search

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

install.packages("lest")
CRAN 30-day downloads, method
317+11.6% up on the 30 days before, the better direction
Test coverage, method
91%of lines run by tests

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.

Maintainer
Stefan Fleck
Latest release
29 Nov 2019
First release
16 Aug 2018

Compare with another package

More details
Releases
2
Needs compilation
Yes
LazyData
true
RoxygenNote
7.0.1.9000
Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' preferred citation:

citation("lest")
APA
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
About

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

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-29. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-29, which the citation names so these numbers can be found later.

All 13 check platforms pass.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    1.1.0
    Time taken
    33 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    1.1.0
    Time taken
    26 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    1.1.0
    Time taken
    21 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    1.1.0
    Time taken
    20 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    1.1.0
    Time taken
    113 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    1.1.0
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    1.1.0
    Time taken
    26 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    1.1.0
    Time taken
    54 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    1.1.0
    Time taken
    24 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    1.1.0
    Time taken
    24 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    1.1.0
    Time taken
    12 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    1.1.0
    Time taken
    30 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    1.1.0
    Time taken
    53 s
  • 13 OK

Over time

No change since 5 Aug 2026

As a list (4)
ChangedWorst statusOKNotesWarningsErrors
5 Aug 2026OK13000
1 Aug 2026Note12100
25 Apr 2026OK12000
10 Mar 2026Note11300

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
328+6.1% up on the 30 days before, the better directionIt is the sum of 3 channels: CRAN, r2u and autoCRAN.

CRAN rank

12,770 of 26,553

CRAN

317 downloads in the last 30 days

Rank
12,770 of 26,553
Change
+11.6% up on the 30 days before, the better direction

It is in the total. Take it out

r2u

8 downloads in the last 30 days

Rank
7,389 of 30,526
Change
−50% down on the 30 days before, the worse direction

It is in the total. Take it out

autoCRAN

3 downloads in the last 30 days

Rank
18,475 of 29,233
Change
−66.7% down on the 30 days before, the worse direction

It is in the total. Take it out

Over time

Compare downloads

Needs
0
Dependent packages
0
Suggested by
0
Optional extras (1)
Functions
76
Public exports
5
Lines of R code
1,269
Median complexity
2
Functions (76)
Size and composition

Lines by kind (2,040)

KindLinesShare
R code1,26962%
Tests39119%
Documentation21010%
Compiled code1708%

Lines by language

LanguageLinesShare
R1,66081%
Rd21010%
C1708%

Languages are counted from file extensions.

Files
28
R functions
71
Compiled functions
5
Complexity
Median
2
Mean
2.03
Highest
11
Median lines per function
3
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
71
Calls
49
Unconnected
23
Groups
3
Growth (2 releases)
Total lines by release
828 on 16 Aug 20182,040 on 29 Nov 2019
Release changes

The tests ran and coverage was measured.

Lines run by tests
90.6%
Expressions run by tests
88.7%
Test cases
23
Exports named in tests
100%
Coverage by file (6)
Coverage run
Lines counted
141
Lines the tests ran
132
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
testthat
Test cases
23
Lines of tests
391
Test lines per line of code
0.31
Exports documented
100%
Arguments documented
83.3%
Return value documented
100%
Help pages with examples
80%
Examples run in checks
100%
Other documentation
README
Yes, 163 words
Release notes file
Yes
Help pages
5
Lines of documentation
210

No repository on record

R releases
  • On CRAN
  • Release
VersionReleasedR
1.1.0 current29 Nov 20193.6.1
1.0.016 Aug 20183.5.1
Release notes (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()