knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
kidney.epi R package includes functions for calculation of eGFR by different equations.
library(kidney.epi) head(ckd.data)
kidney.epi contains a set of functions to calculate eGFR by different equations either for a single patient or for a dataset.
The following eGFR equations are supported:
egfr.ckdepi.cr.2021()
and its alias egfr.ckdepi.cr()
egfr.ckdepi.cr_cys.2021()
egfr.ckdepi.cr.2009()
egfr.ekfc.cr()
egfr.ekfc.cys()
egfr.fas.cr()
egfr.fas.cys()
egfr.fas.cr_cys()
egfr.lm.cr()
egfr.mdrd4()
egfr.bis.cr()
egfr.bis.cr_cys()
egfr.schwartz.cr()
egfr.schwartz.cys()
egfr.schwartz.cr_cys()
egfr.ckid_u25.cr()
egfr.ckid_u25.cys()
egfr.cg.cr()
(even if it calculates creatinine clearance, the 'egfr' is used in the function name) egfr.all_adults.cr()
, egfr.all_adults.cys()
, egfr.all_adults.cr_cys()
- return a data frame with columns representing different eGFR equations If you use these functions from kidney.epi package for the data analysis and manuscript preparation, please cite the package: "Bikbov B. kidney.epi: Kidney-Related Functions for Clinical and Epidemiological Research. Scientific-Tools.Org, https://Scientific-Tools.Org. doi:10.32614/CRAN.package.kidney.epi".
Contact us for data analysis or software development at Scientific-Tools.Org or via 'maintainer("kidney.epi")', connect with the author on LinkedIn.
The vignette demonstrates the usage of eGFR calculation by the CKD-EPI 2009 equation, but race-free CKD-EPI 2021 and other equations work in the same way.
To calculate for a single patient, use the following syntax:
# call egfr.ckdepi.cr.2009 function, and directly set parameters values egfr.ckdepi.cr.2009( creatinine = 1.4, age = 60, sex = "Male", ethnicity = "White", creatinine_units = "mg/dl", label_afroamerican = c("Afroamerican"), label_sex_male = c("Male"), label_sex_female = c("Female") ) # Definitions of the labels for sex and race are optional if you use the same labels defined as default in the function. The following also works well: egfr.ckdepi.cr.2009( creatinine = 1.4, age = 60, sex = "Male", ethnicity = "White", creatinine_units = "mg/dl" ) # If you measure creatinine in micromol/l, it is possible to omit also 'creatinine_units' since the default value is "micromol/l": egfr.ckdepi.cr.2009( creatinine = 103, # creatinine is in micromol/l age = 60, sex = "Male", ethnicity = "White" )
To calculate eGFR for a cohort of patients in a dataset, use the following syntax:
# copy as an example the internal dataframe ckd.data from R package to your dataframe mydata <- ckd.data # calculate eGFR by CKD-EPI equation mydata$ckdepi <- egfr.ckdepi.cr.2009( creatinine = mydata$cr, age = mydata$age, sex = mydata$sex, ethnicity = mydata$ethnicity, creatinine_units = "micromol/L", # customize all labels for those used in the data frame # label(s) used to define male sex in the dataset label_sex_male = c("Male"), # label(s) used to define female sex in the dataset label_sex_female = c("Female"), # label used to define Afroamerican ethnicity in the dataset label_afroamerican = c("Black") ) # show descriptive stat for the calculated values # note that synthetic data set ckd.data contains input parameters for both adults and children, and since the CKD-EPI equation was developed and validated for adults only, the resulting eGFR values for children will be NA. Use children-specific eGFR equations when necessary. summary(mydata$ckdepi)
There are several advantages of the kidney.epi package functions for calculating eGFR values:
References for each eGFR equation are listed in the documentation to the package.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.