diff --git a/DESCRIPTION b/DESCRIPTION
index d74f5ae..276080f 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: epocakir
Title: Clinical Coding of Patients with Kidney Disease
-Version: 0.9.7
+Version: 0.9.8
Authors@R:
c(person(given = "Alwin",
family = "Wang",
@@ -16,7 +16,7 @@ Description: Clinical coding and diagnosis of patients with kidney using
clinical practice guidelines. The guidelines used are the evidence-based
KDIGO guidelines, see for more information.
This package covers acute kidney injury (AKI), anemia, and
- chronic liver disease (CKD).
+ chronic kidney disease (CKD).
License: MIT + file LICENSE
URL: https://github.com/alwinw/epocakir
BugReports: https://github.com/alwinw/epocakir/issues
diff --git a/NEWS.md b/NEWS.md
index 97938ec..0ace410 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,12 @@
+# epocakir 0.9.8
+
+Update README and formatting
+
+## Bug Fixes
+
+- Update readme and description
+- Addressed comments from `goodpractice::gp()`
+
# epocakir 0.9.7
CRAN re-submission
diff --git a/R/aki.R b/R/aki.R
index 7eb9be5..b877899 100644
--- a/R/aki.R
+++ b/R/aki.R
@@ -86,8 +86,7 @@ aki_staging.data.frame <- function(.data,
#' @rdname aki_staging
#' @export
-aki_staging.units <- function(
- SCr = NULL,
+aki_staging.units <- function(SCr = NULL,
bCr = NULL,
UO = NULL,
dttm = NULL,
@@ -107,8 +106,7 @@ aki_staging.units <- function(
#' @rdname aki_staging
#' @export
-aki_staging.numeric <- function(
- SCr = NULL,
+aki_staging.numeric <- function(SCr = NULL,
bCr = NULL,
UO = NULL,
dttm = NULL,
diff --git a/R/ckd.R b/R/ckd.R
index 105fde7..0e543bb 100644
--- a/R/ckd.R
+++ b/R/ckd.R
@@ -58,8 +58,7 @@ eGFR <- function(...) {
UseMethod("eGFR")
}
-eGFR_internal <- function(
- SCr,
+eGFR_internal <- function(SCr,
SCysC,
Age,
height,
@@ -125,8 +124,7 @@ eGFR.data.frame <- function(.data,
#' @rdname eGFR
#' @export
-eGFR.units <- function(
- SCr = NULL,
+eGFR.units <- function(SCr = NULL,
SCysC = NULL,
Age = NULL,
height = NULL,
@@ -161,8 +159,7 @@ eGFR.units <- function(
#' @rdname eGFR
#' @export
-eGFR.numeric <- function(
- SCr = NULL,
+eGFR.numeric <- function(SCr = NULL,
SCysC = NULL,
Age = NULL,
height = NULL,
diff --git a/README.Rmd b/README.Rmd
index 6bba02a..2fbbbf3 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -32,7 +32,7 @@ knitr::opts_chunk$set(
The *epocakir* package makes clinical coding of patients with kidney disease using clinical practice guidelines easy.
The guidelines used are the evidence-based [KDIGO guidelines](https://kdigo.org/guidelines/).
-This package covers acute kidney injury (AKI), anemia, and chronic liver disease(CKD):
+This package covers acute kidney injury (AKI), anemia, and chronic kidney disease (CKD):
- `aki_staging()`: Classification of AKI staging (`aki_stages`) with automatic selection of:
@@ -57,7 +57,7 @@ This package covers acute kidney injury (AKI), anemia, and chronic liver disease
- `eGFR_child_SCysC()`: eGFR based on the pediatric cystatin C-based equation
- `GFR_staging()`: Staging of GFR (`GFR_stages`)
-
+
- Multiple utility functions including:
- `conversion_factors`: Conversion factors used throughout the KDIGO guidelines
diff --git a/README.md b/README.md
index 53014a7..09e8dbd 100644
--- a/README.md
+++ b/README.md
@@ -27,54 +27,54 @@ stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://
The *epocakir* package makes clinical coding of patients with kidney
disease using clinical practice guidelines easy. The guidelines used are
the evidence-based [KDIGO guidelines](https://kdigo.org/guidelines/).
-This package covers acute kidney injury (AKI), anemia, and chronic liver
-disease(CKD):
+This package covers acute kidney injury (AKI), anemia, and chronic
+kidney disease (CKD):
- - `aki_staging()`: Classification of AKI staging (`aki_stages`) with
+- `aki_staging()`: Classification of AKI staging (`aki_stages`) with
automatic selection of:
-
- - `aki_bCr()`: AKI based on baseline creatinine
- - `aki_SCr()`: AKI based on changes in serum creatinine
- - `aki_UO()`: AKI based on urine output
- - `anemia()`: Classification of anemia
+ - `aki_bCr()`: AKI based on baseline creatinine
+ - `aki_SCr()`: AKI based on changes in serum creatinine
+ - `aki_UO()`: AKI based on urine output
- - Classification of albuminuria (`Albuminuria_stages`)
-
- - `Albuminuria_staging_ACR()`: Albuminuria based on Albumin
+- `anemia()`: Classification of anemia
+
+- Classification of albuminuria (`Albuminuria_stages`)
+
+ - `Albuminuria_staging_ACR()`: Albuminuria based on Albumin
excretion rate
- - `Albuminuria_staging_AER()`: Albuminuria based on
+ - `Albuminuria_staging_AER()`: Albuminuria based on
Albumin-to-creatinine ratio
- - `eGFR()`: Estimation of glomerular filtration rate with automatic
+- `eGFR()`: Estimation of glomerular filtration rate with automatic
selection of:
-
- - `eGFR_adult_SCr()`: eGFR based on the 2009 CKD-EPI creatinine
+
+ - `eGFR_adult_SCr()`: eGFR based on the 2009 CKD-EPI creatinine
equation
- - `eGFR_adult_SCysC()`: eGFR based on the 2012 CKD-EPI cystatin C
+ - `eGFR_adult_SCysC()`: eGFR based on the 2012 CKD-EPI cystatin C
equation
- - `eGFR_adult_SCr_SCysC()`: eGFR based on the 2012 CKD-EPI
+ - `eGFR_adult_SCr_SCysC()`: eGFR based on the 2012 CKD-EPI
creatinine-cystatin C equation
- - `eGFR_child_SCr()`: eGFR based on the pediatric creatinine-based
+ - `eGFR_child_SCr()`: eGFR based on the pediatric creatinine-based
equation
- - `eGFR_child_SCr_BUN()`: eGFR based on the pediatric
+ - `eGFR_child_SCr_BUN()`: eGFR based on the pediatric
creatinine-BUN equation
- - `eGFR_child_SCysC()`: eGFR based on the pediatric cystatin
+ - `eGFR_child_SCysC()`: eGFR based on the pediatric cystatin
C-based equation
- - `GFR_staging()`: Staging of GFR (`GFR_stages`)
+- `GFR_staging()`: Staging of GFR (`GFR_stages`)
+
+- Multiple utility functions including:
- - Multiple utility functions including:
-
- - `conversion_factors`: Conversion factors used throughout the
+ - `conversion_factors`: Conversion factors used throughout the
KDIGO guidelines
- - `as_metric()`: Conversion of a measured value into metric units
- - `dob2age()`: Calculation of age from a date of birth
- - `binary2factor()`: Conversion of binary data into factors based
+ - `as_metric()`: Conversion of a measured value into metric units
+ - `dob2age()`: Calculation of age from a date of birth
+ - `binary2factor()`: Conversion of binary data into factors based
on a column name
- - `combine_date_time_cols()`: Combining separate date and time
+ - `combine_date_time_cols()`: Combining separate date and time
columns into a single date and time column
- - `combn_changes`: Generating changes between measurements
+ - `combn_changes`: Generating changes between measurements
## Installation
@@ -131,13 +131,13 @@ glimpse(tidy_obvs)
#> Rows: 3
#> Columns: 8
#> $ `Patient Number` "p10001", "p10002", "p10003"
-#> $ `Admission DateTime` 2020-03-05 14:01:00, 2020-03-06 09:10:00, 2020-03…
-#> $ Discharge_DateTime 2020-03-10 16:34:00, 2020-03-16 18:51:00, 2020-0…
+#> $ `Admission DateTime` 2020-03-05 14:01:00, 2020-03-06 09:10:00, 202...
+#> $ Discharge_DateTime 2020-03-10 16:34:00, 2020-03-16 18:51:00, 202...
#> $ `Date of Birth` "1956-01-09", "1997-12-04", "1973-05-28"
#> $ Male Male, Not_Male, Male
#> $ Height [m] 1.82 [m], 1.61 [m], 1.68 [m]
#> $ Surgery Not_Surgery, Not_Surgery, Surgery
-#> $ Age 2076624000s (~65.8 years), 754272000s (~23.9 yea…
+#> $ Age 2092780800s (~66.32 years), 770428800s (~...
```
Make sure to use `set_units()` from the `units` package to convert all
@@ -152,15 +152,15 @@ possible to classify AKI using `aki_bCr()`, `aki_SCr()` or `aki_UO().`
``` r
head(aki_pt_data)
-#> # A tibble: 6 × 7
-#> SCr_ bCr_ pt_id_ dttm_ UO_ aki_staging_type aki_
-#> [mg/dl] [mg/dl] [ml/kg]
-#> 1 2 1.5 NA NA aki_bCr No AKI
-#> 2 2.5 1.5 NA NA aki_bCr AKI Stage 1
-#> 3 3 1.5 NA NA aki_bCr AKI Stage 2
-#> 4 3.5 1.5 NA NA aki_bCr AKI Stage 2
-#> 5 4 1.5 NA NA aki_bCr AKI Stage 3
-#> 6 4.5 1.5 NA NA aki_bCr AKI Stage 3
+#> # A tibble: 6 x 7
+#> SCr_ bCr_ pt_id_ dttm_ UO_ aki_staging_type aki_
+#> [mg/dl] [mg/dl] [ml/kg]
+#> 1 2.0 1.5 NA NA aki_bCr No AKI
+#> 2 2.5 1.5 NA NA aki_bCr AKI Stag~
+#> 3 3.0 1.5 NA NA aki_bCr AKI Stag~
+#> 4 3.5 1.5 NA NA aki_bCr AKI Stag~
+#> 5 4.0 1.5 NA NA aki_bCr AKI Stag~
+#> 6 4.5 1.5 NA NA aki_bCr AKI Stag~
aki_staging(aki_pt_data,
SCr = "SCr_", bCr = "bCr_", UO = "UO_",
@@ -179,40 +179,40 @@ aki_pt_data %>%
dttm = dttm_, pt_id = pt_id_
)) %>%
select(pt_id_, SCr_:dttm_, aki)
-#> # A tibble: 27 × 5
+#> # A tibble: 27 x 5
#> pt_id_ SCr_ bCr_ dttm_ aki
#> [mg/dl] [mg/dl]
-#> 1 2 1.5 NA No AKI
+#> 1 2.0 1.5 NA No AKI
#> 2 2.5 1.5 NA AKI Stage 1
-#> 3 3 1.5 NA AKI Stage 2
+#> 3 3.0 1.5 NA AKI Stage 2
#> 4 3.5 1.5 NA AKI Stage 2
-#> 5 4 1.5 NA AKI Stage 3
+#> 5 4.0 1.5 NA AKI Stage 3
#> 6 4.5 1.5 NA AKI Stage 3
-#> 7 pt1 3.4 NA 2020-10-23 09:00:00 No AKI
-#> 8 pt1 3.9 NA 2020-10-25 21:00:00 No AKI
-#> 9 pt1 3 NA 2020-10-20 09:00:00 AKI Stage 1
-#> 10 pt2 3.4 NA 2020-10-18 22:00:00 No AKI
-#> # … with 17 more rows
+#> 7 pt1 3.4 NA 2020-10-23 09:00:00 No AKI
+#> 8 pt1 3.9 NA 2020-10-25 21:00:00 No AKI
+#> 9 pt1 3.0 NA 2020-10-20 09:00:00 AKI Stage 1
+#> 10 pt2 3.4 NA 2020-10-18 22:00:00 No AKI
+#> # ... with 17 more rows
aki_pt_data %>%
mutate(aki = aki_SCr(
SCr = SCr_, dttm = dttm_, pt_id = pt_id_
)) %>%
select(pt_id_, SCr_:dttm_, aki)
-#> # A tibble: 27 × 5
+#> # A tibble: 27 x 5
#> pt_id_ SCr_ bCr_ dttm_ aki
#> [mg/dl] [mg/dl]
-#> 1 2 1.5 NA No AKI
+#> 1 2.0 1.5 NA No AKI
#> 2 2.5 1.5 NA No AKI
-#> 3 3 1.5 NA No AKI
+#> 3 3.0 1.5 NA No AKI
#> 4 3.5 1.5 NA No AKI
-#> 5 4 1.5 NA No AKI
+#> 5 4.0 1.5 NA No AKI
#> 6 4.5 1.5 NA No AKI
-#> 7 pt1 3.4 NA 2020-10-23 09:00:00 No AKI
-#> 8 pt1 3.9 NA 2020-10-25 21:00:00 No AKI
-#> 9 pt1 3 NA 2020-10-20 09:00:00 AKI Stage 1
-#> 10 pt2 3.4 NA 2020-10-18 22:00:00 No AKI
-#> # … with 17 more rows
+#> 7 pt1 3.4 NA 2020-10-23 09:00:00 No AKI
+#> 8 pt1 3.9 NA 2020-10-25 21:00:00 No AKI
+#> 9 pt1 3.0 NA 2020-10-20 09:00:00 AKI Stage 1
+#> 10 pt2 3.4 NA 2020-10-18 22:00:00 No AKI
+#> # ... with 17 more rows
```
Similarly, `eGFR()` offers the ability to automatically select the
@@ -223,15 +223,16 @@ particular formula is required, then `eGFR_adult_SCr`,
``` r
head(eGFR_pt_data)
-#> # A tibble: 6 × 10
-#> SCr_ SCysC_ Age_ male_ black_ height_ BUN_ eGFR_calc_type_ eGFR_ pediatric_
-#> [mg/dl] [mg/L] [years] [m] [mg/dl] [mL/1.73m2/min]
-#> 1 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr 139. FALSE
-#> 2 NA 0.4 20 FALSE FALSE NA NA eGFR_adult_SCy… 162. FALSE
-#> 3 0.5 0.4 20 FALSE FALSE NA NA eGFR_adult_SCr… 167. FALSE
-#> 4 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr 150. FALSE
-#> 5 NA 0.4 30 FALSE TRUE NA NA eGFR_adult_SCy… 155. FALSE
-#> 6 0.5 0.4 30 FALSE TRUE NA NA eGFR_adult_SCr… 171. FALSE
+#> # A tibble: 6 x 10
+#> SCr_ SCysC_ Age_ male_ black_ height_ BUN_ eGFR_calc_type_
+#> [mg/dl] [mg/L] [years] [m] [mg/dl]
+#> 1 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr
+#> 2 NA 0.4 20 FALSE FALSE NA NA eGFR_adult_SCy~
+#> 3 0.5 0.4 20 FALSE FALSE NA NA eGFR_adult_SCr~
+#> 4 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr
+#> 5 NA 0.4 30 FALSE TRUE NA NA eGFR_adult_SCy~
+#> 6 0.5 0.4 30 FALSE TRUE NA NA eGFR_adult_SCr~
+#> # ... with 2 more variables: eGFR_ [mL/1.73m2/min], pediatric_
eGFR(eGFR_pt_data,
SCr = "SCr_", SCysC = "SCysC_",
@@ -255,42 +256,42 @@ eGFR_pt_data %>%
male = male_, black = black_, pediatric = pediatric_
)) %>%
select(SCr_:pediatric_, eGFR)
-#> # A tibble: 51 × 11
-#> SCr_ SCysC_ Age_ male_ black_ height_ BUN_ eGFR_calc_type_ eGFR_
-#> [mg/dl] [mg/L] [years] [m] [mg/dl] [mL/1.73m2/min]
-#> 1 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr 139.
-#> 2 NA 0.4 20 FALSE FALSE NA NA eGFR_adult_SCysC 162.
-#> 3 0.5 0.4 20 FALSE FALSE NA NA eGFR_adult_SCr_S… 167.
-#> 4 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr 150.
-#> 5 NA 0.4 30 FALSE TRUE NA NA eGFR_adult_SCysC 155.
-#> 6 0.5 0.4 30 FALSE TRUE NA NA eGFR_adult_SCr_S… 171.
-#> 7 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr 139.
-#> 8 NA 1.2 20 FALSE FALSE NA NA eGFR_adult_SCysC 66.8
-#> 9 0.5 1.2 20 FALSE FALSE NA NA eGFR_adult_SCr_S… 96.4
-#> 10 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr 150.
-#> # … with 41 more rows, and 2 more variables: pediatric_ ,
-#> # eGFR [mL/1.73m2/min]
+#> # A tibble: 51 x 11
+#> SCr_ SCysC_ Age_ male_ black_ height_ BUN_ eGFR_calc_type_
+#> [mg/dl] [mg/L] [years] [m] [mg/dl]
+#> 1 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr
+#> 2 NA 0.4 20 FALSE FALSE NA NA eGFR_adult_SCy~
+#> 3 0.5 0.4 20 FALSE FALSE NA NA eGFR_adult_SCr~
+#> 4 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr
+#> 5 NA 0.4 30 FALSE TRUE NA NA eGFR_adult_SCy~
+#> 6 0.5 0.4 30 FALSE TRUE NA NA eGFR_adult_SCr~
+#> 7 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr
+#> 8 NA 1.2 20 FALSE FALSE NA NA eGFR_adult_SCy~
+#> 9 0.5 1.2 20 FALSE FALSE NA NA eGFR_adult_SCr~
+#> 10 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr
+#> # ... with 41 more rows, and 3 more variables: eGFR_ [mL/1.73m2/min],
+#> # pediatric_ , eGFR [mL/1.73m2/min]
eGFR_pt_data %>%
dplyr::mutate(eGFR = eGFR_adult_SCr(
SCr = SCr_, Age = Age_, male = male_, black = black_
)) %>%
select(SCr_:pediatric_, eGFR)
-#> # A tibble: 51 × 11
-#> SCr_ SCysC_ Age_ male_ black_ height_ BUN_ eGFR_calc_type_ eGFR_
-#> [mg/dl] [mg/L] [years] [m] [mg/dl] [mL/1.73m2/min]
-#> 1 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr 139.
-#> 2 NA 0.4 20 FALSE FALSE NA NA eGFR_adult_SCysC 162.
-#> 3 0.5 0.4 20 FALSE FALSE NA NA eGFR_adult_SCr_S… 167.
-#> 4 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr 150.
-#> 5 NA 0.4 30 FALSE TRUE NA NA eGFR_adult_SCysC 155.
-#> 6 0.5 0.4 30 FALSE TRUE NA NA eGFR_adult_SCr_S… 171.
-#> 7 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr 139.
-#> 8 NA 1.2 20 FALSE FALSE NA NA eGFR_adult_SCysC 66.8
-#> 9 0.5 1.2 20 FALSE FALSE NA NA eGFR_adult_SCr_S… 96.4
-#> 10 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr 150.
-#> # … with 41 more rows, and 2 more variables: pediatric_ ,
-#> # eGFR [mL/1.73m2/min]
+#> # A tibble: 51 x 11
+#> SCr_ SCysC_ Age_ male_ black_ height_ BUN_ eGFR_calc_type_
+#> [mg/dl] [mg/L] [years] [m] [mg/dl]
+#> 1 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr
+#> 2 NA 0.4 20 FALSE FALSE NA NA eGFR_adult_SCy~
+#> 3 0.5 0.4 20 FALSE FALSE NA NA eGFR_adult_SCr~
+#> 4 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr
+#> 5 NA 0.4 30 FALSE TRUE NA NA eGFR_adult_SCy~
+#> 6 0.5 0.4 30 FALSE TRUE NA NA eGFR_adult_SCr~
+#> 7 0.5 NA 20 FALSE FALSE NA NA eGFR_adult_SCr
+#> 8 NA 1.2 20 FALSE FALSE NA NA eGFR_adult_SCy~
+#> 9 0.5 1.2 20 FALSE FALSE NA NA eGFR_adult_SCr~
+#> 10 0.5 NA 30 FALSE TRUE NA NA eGFR_adult_SCr
+#> # ... with 41 more rows, and 3 more variables: eGFR_ [mL/1.73m2/min],
+#> # pediatric_ , eGFR [mL/1.73m2/min]
```
## References
@@ -308,7 +309,7 @@ commit](https://img.shields.io/github/last-commit/alwinw/epocakir)
bytes](https://img.shields.io/github/repo-size/alwinw/epocakir) ![Total
Lines](https://img.shields.io/tokei/lines/github/alwinw/epocakir)
------
+------------------------------------------------------------------------
See for more
usage details and package reference.
diff --git a/codemeta.json b/codemeta.json
index 0447c9c..59973a4 100644
--- a/codemeta.json
+++ b/codemeta.json
@@ -1,8 +1,11 @@
{
- "@context": ["https://doi.org/10.5063/schema/codemeta-2.0", "http://schema.org"],
+ "@context": [
+ "https://doi.org/10.5063/schema/codemeta-2.0",
+ "http://schema.org"
+ ],
"@type": "SoftwareSourceCode",
"identifier": "epocakir",
- "description": "Clinical coding and diagnosis of patients with kidney using\n clinical practice guidelines. The guidelines used are the evidence-based\n KDIGO guidelines, see for more information.\n This package covers acute kidney injury (AKI), anemia, and\n chronic liver disease (CKD).",
+ "description": "Clinical coding and diagnosis of patients with kidney using\n clinical practice guidelines. The guidelines used are the evidence-based\n KDIGO guidelines, see for more information.\n This package covers acute kidney injury (AKI), anemia, and\n chronic kidney disease (CKD).",
"name": "epocakir: Clinical Coding of Patients with Kidney Disease",
"codeRepository": "https://github.com/alwinw/epocakir",
"issueTracker": "https://github.com/alwinw/epocakir/issues",
@@ -236,8 +239,17 @@
"releaseNotes": "https://github.com/alwinw/epocakir/blob/master/NEWS.md",
"readme": "https://github.com/alwinw/epocakir/blob/master/README.md",
"fileSize": "135.26KB",
- "contIntegration": ["https://github.com/alwinw/epocakir/actions", "https://codecov.io/gh/alwinw/epocakir?branch=master"],
+ "contIntegration": [
+ "https://github.com/alwinw/epocakir/actions",
+ "https://codecov.io/gh/alwinw/epocakir?branch=master"
+ ],
"developmentStatus": "https://lifecycle.r-lib.org/articles/stages.html#stable",
- "keywords": ["r", "kdigo-guidelines", "kdigo", "medical", "kidney-disease"],
+ "keywords": [
+ "r",
+ "kdigo-guidelines",
+ "kdigo",
+ "medical",
+ "kidney-disease"
+ ],
"relatedLink": "https://CRAN.R-project.org/package=epocakir"
-}
+}
\ No newline at end of file