{"id":22356645,"url":"https://github.com/finnishcancerregistry/dbc","last_synced_at":"2025-03-26T13:15:49.406Z","repository":{"id":46697087,"uuid":"274845933","full_name":"FinnishCancerRegistry/dbc","owner":"FinnishCancerRegistry","description":"Design-by-contract: verify your function inputs and outputs. Includes a large number of generated verifcation functions for convenience.","archived":false,"fork":false,"pushed_at":"2025-02-12T10:12:16.000Z","size":1515,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T11:27:35.746Z","etag":null,"topics":["assertions","contract-programming","data-validation","defensive-programming","design-by-contract","error-checking","function-validation","input-validation","output-validation","r","r-package","runtime-validation"],"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/FinnishCancerRegistry.png","metadata":{"files":{"readme":"README.md","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":"2020-06-25T06:36:18.000Z","updated_at":"2025-02-12T10:12:19.000Z","dependencies_parsed_at":"2023-12-04T13:25:16.454Z","dependency_job_id":"4118dd53-d1c0-4ccf-a9d4-fbb0ac2c7bf5","html_url":"https://github.com/FinnishCancerRegistry/dbc","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinnishCancerRegistry%2Fdbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinnishCancerRegistry%2Fdbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinnishCancerRegistry%2Fdbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinnishCancerRegistry%2Fdbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FinnishCancerRegistry","download_url":"https://codeload.github.com/FinnishCancerRegistry/dbc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245659054,"owners_count":20651526,"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":["assertions","contract-programming","data-validation","defensive-programming","design-by-contract","error-checking","function-validation","input-validation","output-validation","r","r-package","runtime-validation"],"created_at":"2024-12-04T14:11:32.894Z","updated_at":"2025-03-26T13:15:49.375Z","avatar_url":"https://github.com/FinnishCancerRegistry.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003c!-- generated by R package codedoc; do not modify! --\u003e\n\n# Package `dbc`\n\n\n`dbc` is designed to aid writing functions under the design by contract\nphilosophy, where function inputs and outputs are programmatically\nasserted to adhere to specifications.\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/FinnishCancerRegistry/dbc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/FinnishCancerRegistry/dbc/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\n# Recommended installation\n\n```r\ndevtools::install_github(\n  \"FinnishCancerRegistry/dbc\",\n  ref = readline(\"enter latest tag on github: \")\n)\n```\n\n# Example\n```r\n# by adding arg assertion_type, you can use the same function for end-user\n# purposes and internal purposes with clear error messages.\nmy_fun \u003c- function(df, by, assertion_type = NULL) {\n  dbc::assert_is_character_nonNA_vector(\n    x = by,\n    assertion_type = assertion_type\n  )\n  dbc::assert_is_data_frame_with_required_names(\n    x = df,\n    required_names = by,\n    assertion_type = assertion_type\n  )\n  return(table(df[,by]))\n}\nmy_fun(df, c(\"var_1\", \"var_2\"))\nmy_fun_2 \u003c- function(df) {\n  my_fun(df, c(\"var_1\", \"var_2\"), assertion_type = \"prod_input\")\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinnishcancerregistry%2Fdbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinnishcancerregistry%2Fdbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinnishcancerregistry%2Fdbc/lists"}