{"id":20134960,"url":"https://github.com/wireservice/lookupr","last_synced_at":"2025-10-04T21:38:21.197Z","repository":{"id":66128640,"uuid":"89264411","full_name":"wireservice/lookupr","owner":"wireservice","description":"Fetch common lookup tables and join them to your data. (A port of agate-lookup to R.)","archived":false,"fork":false,"pushed_at":"2017-04-26T21:17:25.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T22:30:56.338Z","etag":null,"topics":["data","dplyr","lookup","r","tables","tidyverse"],"latest_commit_sha":null,"homepage":"","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/wireservice.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","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,"publiccode":null,"codemeta":null}},"created_at":"2017-04-24T16:44:43.000Z","updated_at":"2023-11-20T22:20:39.000Z","dependencies_parsed_at":"2023-02-21T20:31:03.273Z","dependency_job_id":null,"html_url":"https://github.com/wireservice/lookupr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wireservice/lookupr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wireservice%2Flookupr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wireservice%2Flookupr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wireservice%2Flookupr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wireservice%2Flookupr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wireservice","download_url":"https://codeload.github.com/wireservice/lookupr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wireservice%2Flookupr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264922866,"owners_count":23683701,"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":["data","dplyr","lookup","r","tables","tidyverse"],"created_at":"2024-11-13T21:12:56.199Z","updated_at":"2025-10-04T21:38:16.160Z","avatar_url":"https://github.com/wireservice.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\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\n# lookupr\n\nLookup pulls common lookup tables from the [lookup](https://github.com/wireservice/lookup) repository and joins them to your data.\n\nThis is a port of Python's [agate-lookup](https://agate-lookup.readthedocs.io).\n\nThis version does not do caching. If you don't want to redownload lookup tables, save a local copy of your results.\n\n## Install\n\nFrom Github:\n\n``` r\ninstall.packages(\"devtools\")\ndevtools::install_github(\"wireservice/lookupr\")\n```\n\n## Usage\n\nLoad libraries:\n\n```{r, message = FALSE}\nlibrary(dplyr)\nlibrary(lookupr)\n```\n\nLookup the consumer price index for yearly data:\n\n```{r}\ndata \u003c- data.frame(year = c(\"2004\", \"2005\", \"2006\", \"2007\"))\n\ndata %\u003e%\n  lookup(\"year\", \"cpi\")\n```\n\nIf you're column name is different from `year`:\n\n```{r}\ndata \u003c- data.frame(anum = c(\"2004\", \"2005\", \"2006\", \"2007\"))\n\ndata %\u003e%\n  lookup(\"anum\", \"cpi\", lookup_keys = \"year\")\n```\n\nMonthly CPI:\n\n```{r}\ndata \u003c- data.frame(\n  year = c(\"2004\", \"2004\", \"2005\", \"2005\"),\n  month = c(\"11\", \"12\", \"1\", \"2\")\n)\n\ndata %\u003e%\n  lookup(c(\"year\", \"month\"), \"cpi\", version=\"sa\")\n```\n\n## Inflation adjustment\n\nAs it's such a common use-case, lookup includes shortcut functions for doing CPI adjustment:\n\n```{r}\ndata \u003c- data.frame(\n  year = c(\"2005\", \"2006\", \"2007\", \"2008\", \"2009\", \"2010\"),\n  price_a = c(100, 100, 100, 100, 100, 100),\n  price_b = c(200, 200, 200, 200, 200, 200)\n)\n\ndata %\u003e%\n  lookup_cpi(c(\"price_a\", \"price_b\"), base = \"2010\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwireservice%2Flookupr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwireservice%2Flookupr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwireservice%2Flookupr/lists"}