{"id":18733510,"url":"https://github.com/insightsengineering/dunlin","last_synced_at":"2025-04-12T18:31:43.040Z","repository":{"id":211900401,"uuid":"458305019","full_name":"insightsengineering/dunlin","owner":"insightsengineering","description":"Tools for Clinical Trial Data Wrangling","archived":false,"fork":false,"pushed_at":"2025-04-09T14:32:14.000Z","size":14766,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-09T15:21:29.982Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://insightsengineering.github.io/dunlin/","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/insightsengineering.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://pharmaverse.org"]}},"created_at":"2022-02-11T18:52:01.000Z","updated_at":"2025-03-14T09:22:31.000Z","dependencies_parsed_at":"2024-08-28T13:53:46.615Z","dependency_job_id":"d7048eb9-30f6-4df9-8154-bfe604249ee1","html_url":"https://github.com/insightsengineering/dunlin","commit_stats":null,"previous_names":["insightsengineering/dunlin"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fdunlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fdunlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fdunlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fdunlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insightsengineering","download_url":"https://codeload.github.com/insightsengineering/dunlin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248613519,"owners_count":21133527,"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":[],"created_at":"2024-11-07T15:10:04.655Z","updated_at":"2025-04-12T18:31:42.531Z","avatar_url":"https://github.com/insightsengineering.png","language":"R","funding_links":["https://pharmaverse.org"],"categories":[],"sub_categories":[],"readme":"# `dunlin`: Tools for Clinical Trial Data Wrangling\n\n\u003c!-- start badges --\u003e\n[![Check 🛠](https://github.com/insightsengineering/dunlin/actions/workflows/check.yaml/badge.svg)](https://insightsengineering.github.io/dunlin/main/unit-test-report/)\n[![Docs 📚](https://github.com/insightsengineering/dunlin/actions/workflows/docs.yaml/badge.svg)](https://insightsengineering.github.io/dunlin/)\n[![Code Coverage 📔](https://raw.githubusercontent.com/insightsengineering/dunlin/_xml_coverage_reports/data/main/badge.svg)](https://insightsengineering.github.io/dunlin/main/coverage-report/)\n\n![GitHub forks](https://img.shields.io/github/forks/insightsengineering/dunlin?style=social)\n![GitHub repo stars](https://img.shields.io/github/stars/insightsengineering/dunlin?style=social)\n\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/insightsengineering/dunlin)\n![GitHub contributors](https://img.shields.io/github/contributors/insightsengineering/dunlin)\n![GitHub last commit](https://img.shields.io/github/last-commit/insightsengineering/dunlin)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/insightsengineering/dunlin)\n![GitHub repo size](https://img.shields.io/github/repo-size/insightsengineering/dunlin)\n![GitHub language count](https://img.shields.io/github/languages/count/insightsengineering/dunlin)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![Current Version](https://img.shields.io/github/r-package/v/insightsengineering/dunlin/main?color=purple\\\u0026label=package%20version)](https://github.com/insightsengineering/dunlin/tree/main)\n[![Open Issues](https://img.shields.io/github/issues-raw/insightsengineering/dunlin?color=red\\\u0026label=open%20issues)](https://github.com/insightsengineering/dunlin/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)\n\u003c!-- end badges --\u003e\n\n`dunlin` provides a variety of data tools to reformat and manipulate a subset of the tables in a data set.\n\n## Installation\n\n```r\n# install.packages(\"pak\")\npak::pak(\"insightsengineering/dunlin@*release\")\n```\n\nAlternatively, you might also use the development version.\n\n```r\n# install.packages(\"pak\")\npak::pak(\"insightsengineering/dunlin\")\n```\n\n## Usage\n\n  ```r\n  library(dunlin)\n\n  df1 \u003c- data.frame(\n    \"id\" = c(\"a\", \"b\", NA, \"a\", \"k\", \"x\"),\n    \"id2\" = factor(c(\"f1\", \"f2\", NA, NA, \"f1\", \"f1\")),\n    \"val\" = letters[1:6]\n  )\n  df2 \u003c- data.frame(\n    \"id\" = c(\"a\", \"b\", NA, \"a\", \"k\", \"x\"),\n    \"id2\" = factor(c(\"f1\", \"f2\", NA, NA, \"f1\", \"f1\")),\n    \"num\" = 1:6\n  )\n\n  db \u003c- list(df1 = df1, df2 = df2)\n\n  prop_db \u003c- propagate(db, \"df1\", \"val\", c(\"id\", \"id2\"))\n  ```\n\n  which returns `prop_db` as\n\n  ```text\n   $df1\n      id  id2 val\n  1    a   f1   a\n  2    b   f2   b\n  3 \u003cNA\u003e \u003cNA\u003e   c\n  4    a \u003cNA\u003e   d\n  5    k   f1   e\n  6    x   f1   f\n\n  $df2\n      id  id2 num val\n  1    a   f1   1   a\n  2    b   f2   2   b\n  3 \u003cNA\u003e \u003cNA\u003e   3   c\n  4    a \u003cNA\u003e   4   d\n  5    k   f1   5   e\n  6    x   f1   6   f\n  ```\n\n  ```r\n  new_format \u003c- list(\n    df1 = list(\n      id = rule(\"No ID available\" = c(\"\", NA, \"\u003cMissing\u003e\")),\n      id2 = rule(\"\u003cMissing\u003e\" = c(\"\", NA, \"\u003cMissing\u003e\"))\n    )\n  )\n\n  res \u003c- reformat(prop_db, new_format, .na_last = TRUE)\n\n  ```\n\n  which result in `res` as\n\n  ```text\n  $df1\n                 id       id2 val\n  1               a        f1   a\n  2               b        f2   b\n  3 No ID available \u003cMissing\u003e   c\n  4               a \u003cMissing\u003e   d\n  5               k        f1   e\n  6               x        f1   f\n\n  $df2\n      id  id2 num val\n  1    a   f1   1   a\n  2    b   f2   2   b\n  3 \u003cNA\u003e \u003cNA\u003e   3   c\n  4    a \u003cNA\u003e   4   d\n  5    k   f1   5   e\n  6    x   f1   6   f\n  ```\n\n## Stargazers and Forkers\n\n### Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/insightsengineering/dunlin.svg)](https://starchart.cc/insightsengineering/dunlin)\n\n### Stargazers\n\n[![Stargazers repo roster for dunlin](https://reporoster.com/stars/insightsengineering/dunlin)](https://github.com/insightsengineering/dunlin/stargazers)\n\n[![Forkers repo roster for dunlin](https://reporoster.com/forks/insightsengineering/dunlin)](https://github.com/insightsengineering/dunlin/network/members)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Fdunlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsightsengineering%2Fdunlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Fdunlin/lists"}