{"id":16273535,"url":"https://github.com/jimhester/lambda","last_synced_at":"2026-03-07T09:33:00.039Z","repository":{"id":136989693,"uuid":"42772030","full_name":"jimhester/lambda","owner":"jimhester","description":"Simple anonymous functions","archived":false,"fork":false,"pushed_at":"2015-09-22T13:33:32.000Z","size":144,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T08:12:22.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jimhester.png","metadata":{"files":{"readme":"README.Rmd","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}},"created_at":"2015-09-19T12:32:21.000Z","updated_at":"2021-01-07T07:01:53.000Z","dependencies_parsed_at":"2023-03-13T10:58:44.260Z","dependency_job_id":null,"html_url":"https://github.com/jimhester/lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jimhester/lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimhester%2Flambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimhester%2Flambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimhester%2Flambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimhester%2Flambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimhester","download_url":"https://codeload.github.com/jimhester/lambda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimhester%2Flambda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30210849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-10T18:24:37.499Z","updated_at":"2026-03-07T09:33:00.020Z","avatar_url":"https://github.com/jimhester.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput:\n  md_document:\n    variant: markdown_github\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n# Lambda\n\n[![Travis-CI Build Status](https://travis-ci.org/jimhester/lambda.svg?branch=master)](https://travis-ci.org/jimhester/lambda)\n[![Coverage Status](https://img.shields.io/codecov/c/github/jimhester/lambda/master.svg)](https://codecov.io/github/jimhester/lambda?branch=master)\n\nLambda contains only one function `f()`, which allows you to write new\nfunctions in a very compact format.\n\nSimply write the body of the function as you would normally.  If you want a\ngiven variable to appear as one of the arguments to the function, surround it with\n`.()`.  Default arguments can be also be specified within `.()` as you normally\nwould in the argument list.\n\n\n```{r}\nlibrary(lambda)\n\nfunction(x, y) x + y\nf(.(x) + .(y))\n\nReduce(f(.(x) + .(y)), 1:10)\n\nadd \u003c- f(.(x) + .(y = 5))\nadd\n\nadd(1)\n\nadd(1, 2)\n```\n\nIt works very well as a way to compactly define simple utility functions\n```{r}\nx \u003c- list(1, list(NULL), 2)\ncompact \u003c- f(Filter(Negate(is.null), .(x)))\ncompact\ncompact(x)\n```\n\nOr for partial function application\n```{r}\nf1 \u003c- f(runif(n = rpois(1, 5), .(...)))\nf1\n```\n\n## References\n\nFor a different (better?) approach to this same idea, see\n[pryr::f()](https://github.com/hadley/pryr/blob/master/R/f.r).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimhester%2Flambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimhester%2Flambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimhester%2Flambda/lists"}