{"id":22174484,"url":"https://github.com/s-fleck/lest","last_synced_at":"2025-07-26T15:32:06.213Z","repository":{"id":89608420,"uuid":"143680243","full_name":"s-fleck/lest","owner":"s-fleck","description":"Vectorised Nested if-else Statements Similar to SQL CASE WHEN (forked from dplyr)","archived":false,"fork":false,"pushed_at":"2024-02-09T08:47:38.000Z","size":71,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-01T12:47:17.465Z","etag":null,"topics":["dplyr","ifelse","r","recoding"],"latest_commit_sha":null,"homepage":"https://s-fleck.github.io/lest/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s-fleck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-08-06T05:26:32.000Z","updated_at":"2024-08-22T10:41:32.000Z","dependencies_parsed_at":"2024-02-09T09:57:56.899Z","dependency_job_id":null,"html_url":"https://github.com/s-fleck/lest","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-fleck%2Flest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-fleck%2Flest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-fleck%2Flest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-fleck%2Flest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s-fleck","download_url":"https://codeload.github.com/s-fleck/lest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227692777,"owners_count":17805175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dplyr","ifelse","r","recoding"],"created_at":"2024-12-02T07:50:27.980Z","updated_at":"2024-12-02T07:50:28.813Z","avatar_url":"https://github.com/s-fleck.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"**This package is obsolete as dplyr has saner dependencies now, and data.table also implemented a similar function**\n\n# lest\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/lest)](https://cran.r-project.org/package=lest)\n[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)\n[![Travis build status](https://travis-ci.org/s-fleck/lest.svg?branch=master)](https://travis-ci.org/s-fleck/lest)\n\u003c!-- badges: end --\u003e\n\nLest provides two functions for vectorised conditional recoding of variables.\n`case_when()` enables you to vectorise multiple `if` and `else` statements (like\n`CASE WHEN` in SQL). `if_else()` is a stricter and more predictable version of\n`base::ifelse()` that preserves attributes (and therefore works with Dates). The\nfunctions in lest are forks of the\n[dplyr](https://CRAN.R-project.org/package=dplyr) functions of\nthe same name. For more infos please refer to the [documentation](https://s-fleck.github.io/lest/).\n\n\nWhy use lest?\n----------------------------------\n\nUse this package if you like the semantics of `dplyr::case_when()`, but do not \nwant to use dplyr because of the dependencies it comes with. \n**If you already use dplyr in your project, you gain no advantage from lest**. \n`lest::case_when()` and `lest::if_else()` behave exactly identical to \nthe dplyr equivalents, just that they do not support tidyeval syntax \n(like `!!!`).\n\n\nDependencies\n----------------------------------\n\n**lest** depends only on base R, and will never add any external dependencies.\n\n\nInstallation\n------------\n\nYou can install lest from GitHub with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"s-fleck/lest\")\n```\n\n\nExample\n-------\n\n``` r\nx \u003c- 1:50\n\ncase_when(\n  x %% 35 == 0 ~ \"fizz buzz\",\n  x %% 5 == 0 ~ \"fizz\",\n  x %% 7 == 0 ~ \"buzz\",\n  TRUE ~ as.character(x)\n)\n\ncase_when(\n  x %% 35 == 0 ~ 35,\n  x %% 5 == 0 ~ 5,\n  x %% 7 == 0 ~ 7,\n  TRUE ~ NA\n)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-fleck%2Flest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs-fleck%2Flest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-fleck%2Flest/lists"}