{"id":32200480,"url":"https://github.com/konstantinryabov/dmtools","last_synced_at":"2025-10-22T03:49:03.228Z","repository":{"id":55592752,"uuid":"262395018","full_name":"KonstantinRyabov/dmtools","owner":"KonstantinRyabov","description":"Tools for Clinical Data Management","archived":false,"fork":false,"pushed_at":"2023-01-05T23:19:34.000Z","size":560,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T03:48:53.968Z","etag":null,"topics":["cdisc","clinical-data-management","laboratory-reference-range-validate"],"latest_commit_sha":null,"homepage":"https://konstantinryabov.github.io/dmtools/","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/KonstantinRyabov.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":"2020-05-08T18:10:07.000Z","updated_at":"2023-01-05T23:19:40.000Z","dependencies_parsed_at":"2023-02-04T23:17:06.588Z","dependency_job_id":null,"html_url":"https://github.com/KonstantinRyabov/dmtools","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/KonstantinRyabov/dmtools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonstantinRyabov%2Fdmtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonstantinRyabov%2Fdmtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonstantinRyabov%2Fdmtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonstantinRyabov%2Fdmtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KonstantinRyabov","download_url":"https://codeload.github.com/KonstantinRyabov/dmtools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonstantinRyabov%2Fdmtools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280376536,"owners_count":26320276,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cdisc","clinical-data-management","laboratory-reference-range-validate"],"created_at":"2025-10-22T03:49:01.988Z","updated_at":"2025-10-22T03:49:03.217Z","avatar_url":"https://github.com/KonstantinRyabov.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"README\"\nauthor: \"Konstantin\"\ndate: \"07 04 2020\"\noutput: md_document\n---\n# dmtools  \u003cimg src='man/figures/logo.png' align=\"right\" height=\"170\" /\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/dmtools)](https://CRAN.R-project.org/package=dmtools)\n[![Build Status](https://travis-ci.com/chachabooms/dmtools.svg?token=pmH5ZxVz4xaZTjx5TDKs\u0026branch=master)](https://travis-ci.com/chachabooms/dmtools) [![codecov](https://codecov.io/gh/KonstantinRyabov/dmtools/branch/master/graph/badge.svg?token=AEKUFWUUXZ)](https://codecov.io/gh/KonstantinRyabov/dmtools)\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n## Installation\n```{r install, eval = FALSE}\ninstall.packages(\"dmtools\")\n\n# dev-version\ndevtools::install_github(\"KonstantinRyabov/dmtools\")\n\nlibrary(dmtools)\n```\n\n## Overview\nFor checking the dataset from EDC in clinical trials. \nNotice, your dataset should have a postfix( \\_V1 ) or a prefix( V1\\_ ) in the names of variables. Column names should be unique.\n\n* `date()` - create object date to check dates in the dataset\n* `lab()` - create object lab to check lab reference range\n* `short()` - create object short to reshape the dataset in a tidy view.\n* `check()` - check objects\n* `get_result()` - get the final result of object\n* `choose_test()` - filter the final result of `check()`\n* `rename_dataset()` - rename the dataset\n\n## Usage\n\nFor example, you want to check laboratory values, you need to create the excel table like in the example.  \n\n* AGELOW - number, \u003e= number\n* AGEHIGH - if none, type Inf, \u003c= number  \n* SEX - for both sex, use `|`\n* LBTEST - What was the lab test name? (can be any convenient name for you)\n* LBORRES* - What was the result of the lab test?\n* LBNRIND* - How [did/do] the reported values compare within the [reference/normal/expected] range?\n* LBORNRLO - What was the lower limit of the reference range for this lab test, \u003e= \n* LBORNRHI - What was the high limit of the reference range for this lab test, \u003c=\n\n*column names without prefix or postfix\n\n```{r refer, echo = FALSE, result = 'asis', warning = FALSE, message = FALSE}\nlibrary(knitr)\nlibrary(dmtools)\nlibrary(dplyr)\n\nrefs \u003c- system.file(\"labs_refer.xlsx\", package = \"dmtools\")\nrefers \u003c- readxl::read_xlsx(refs)\nkable(refers, caption = \"lab reference ranges\")\n```\n\n\n```{r dataset, echo = FALSE, result = 'asis'}\n\nID \u003c- c(\"01\", \"02\", \"03\")\nAGE \u003c- c(\"19\", \"20\", \"22\")\nSEX \u003c- c(\"f\", \"m\", \"m\")\nGLUC_V1 \u003c- c(\"5.5\", \"4.1\", \"9.7\")\nGLUC_IND_V1 \u003c- c(\"norm\", NA, \"norm\")\nAST_V2 \u003c- c(\"30\", \"48\", \"31\")\nAST_IND_V2 \u003c- c(\"norm\", \"norm\", \"norm\")\n\ndf \u003c- data.frame(\n  ID, AGE, SEX,\n  GLUC_V1, GLUC_IND_V1,\n  AST_V2, AST_IND_V2,\n  stringsAsFactors = F\n)\n\nkable(df, caption = \"dataset\")\n```\n\n\n```{r lab}\n# \"norm\" and \"no\" it is an example, necessary variable for the estimate, get from the dataset\nrefs \u003c- system.file(\"labs_refer.xlsx\", package = \"dmtools\")\nobj_lab \u003c- lab(refs, ID, AGE, SEX, \"norm\", \"no\")\nobj_lab \u003c- obj_lab %\u003e% check(df)\n\n# ok - analysis, which has a correct estimate of the result\nobj_lab %\u003e% choose_test(\"ok\")\n\n# mis - analysis, which has an incorrect estimate of the result\nobj_lab %\u003e% choose_test(\"mis\")\n\n# skip - analysis, which has an empty value of the estimate\nobj_lab %\u003e% choose_test(\"skip\")\n```\n\n```{r strange_dataset, echo = FALSE, result = 'asis'}\n\nID \u003c- c(\"01\", \"02\", \"03\")\nAGE \u003c- c(\"19\", \"20\", \"22\")\nSEX \u003c- c(\"f\", \"m\", \"m\")\nV1_GLUC \u003c- c(\"5,5\", \"4,1\", \"9,7\")\nV1_GLUC_IND \u003c- c(\"norm\", NA, \"norm\")\nV2_AST \u003c- c(\" \u003c 5\", \"48\", \"31\")\nV2_AST_IND \u003c- c(\"norm\", \"norm\", \"norm\")\n\nstrange_df \u003c- data.frame(\n  ID, AGE, SEX,\n  V1_GLUC, V1_GLUC_IND,\n  V2_AST, V2_AST_IND,\n  stringsAsFactors = F\n)\n\nkable(strange_df, caption = \"strange_dataset\")\n```\n\n```{r stange_lab}\n# dmtools can work with the dataset as strange_df\n# parameter is_post has value FALSE because a dataset has a prefix( V1_ ) in the names of variables\nobj_lab \u003c- lab(refs, ID, AGE, SEX, \"norm\", \"no\", is_post = F)\nobj_lab \u003c- obj_lab %\u003e% check(strange_df)\n\n# dmtools can understand the value with a comma like 6,6 \nobj_lab %\u003e% choose_test(\"ok\")\n\n# Notice, if dmtools can't understand the value of lab_vals e.g. \u003c 5, it puts Inf in the RES_TYPE_NUM\nobj_lab %\u003e% choose_test(\"mis\")\n\nobj_lab %\u003e% choose_test(\"skip\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonstantinryabov%2Fdmtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonstantinryabov%2Fdmtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonstantinryabov%2Fdmtools/lists"}