Learn R Programming

clinPK: Clinical Pharmacokinetics Toolkit

Overview

The clinPK package provides equations commonly used in clinical pharmacokinetics and clinical pharmacology, such as equations for dose individualization, compartmental pharmacokinetics, drug exposure, anthropomorphic calculations, clinical chemistry, and conversion of common clinical parameters. Where possible and relevant, it provides multiple published and peer-reviewed equations within the respective R function.

Installation

The development version of clinPK always has the most up-to-date improvements and bug fixes. We aim to release clinPK on CRAN at least once a year, depending on the number and impact of updates made to the development version.

The CRAN version of clinPK can be installed using:

install.packages("clinPK")

The development version of clinPK can be installed using:

devtools::install_github("InsightRX/clinPK")

Contributing

We welcome input from the community:

  • If you think you have encountered a bug, please submit an issue on the GitHub

page. Please include a reproducible example of the unexpected behavior.

  • Please open a pull request if you have a fix or updates that would improve the package. If you're not sure if your proposed

changes are useful or within scope of the package, feel free to contact one of the authors of this package.

Disclaimer

The functionality in this R package is provided "as is". While its authors adhere to software development best practices, the software may still contain unintended errors.

InsightRX Inc. and the authors of this package can not be held liable for any damages resulting from any use of this software. By the use of this software package, the user waives all warranties, expressed or implied, including any warranties to the accuracy, quality or suitability of InsightRX for any particular purpose, either medical or non-medical.


Copy Link

Version

Install

install.packages('clinPK')

Monthly Downloads

338

Version

0.13.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Ron Keizer

Last Published

February 23rd, 2024

Functions in clinPK (0.13.0)

calc_creat

Estimate serum creatinine
calc_t12

Calculate half-life based on two points
calc_neutropenia_grade

Calculate neutropenia grade from ANC
dose2auc

Convert dose to expected AUCinf or AUCt for 1 compartment linear PK model
calc_ffm

Calculate fat-free mass
calc_lbw

Calculate lean body weight
convert_creat_assay

Convert serum creatinine from various assays to Jaffe
convert_flow_unit

Convert flow (e.g. clearance) from / to units
lbs2kg

Convert lbs to kg
convert_creat_unit

Convert creatinine to different unit
cm2inch

Convert cm to inch
mean_step

Calculate mean between two values in a vector Used in NCA for calculation of mean between two or more timepoints.
kg2oz

Convert kg to oz
pct_weight_for_age

Percentile weight for age for children
kdigo_stage

Calculate AKI stage according to KDIGO criteria
clinPK-package

clinPK
oz2kg

Convert oz to kg
kg2lbs

Convert kg to lbs
mol2conc

Convert molar to concentration
check_covs_available

Checks whether required covariates for eGFR calculations are present
egfr_cov_reqs

Returns parameters needed to calculate eGFR according to the method specified.
pk_1cmt_inf_dose_from_cmax

Calculate dose to achieve steady state Cmax for 1-compartmental PK model with infusion dosing at steady state
nca

Perform an NCA based on a NONMEM-style dataset
pk_1cmt_bolus

Concentration predictions for 1-compartmental PK model after single or multiple bolus doses
pk_2cmt_bolus_ss

Concentration predictions for 2-compartmental PK model, bolus dosing at steady state
pk_1cmt_inf_dose_for_range

Calculate dose based on a given AUC24, Cmax, and Cmin, assuming 1-compartment model
is.nil

Check if values in vector are empty
find_factor

Helper function to grab the conversion factor from an input unit and given list
calc_kel_single_tdm

Calculate elimination rate when given a single TDM sample
pk_2cmt_bolus_dose_from_cmin

Calculate dose to achieve steady state trough for 2-compartmental PK model bolus dosing at steady state
pk_1cmt_inf_cmax_ss

Cmax for linear 1-compartment PK model at steady state
pk_1cmt_inf_cmin_ss

Cmin (trough) for linear 1-compartment PK model at steady state
pk_2cmt_bolus

Concentration predictions for 2-compartmental PK model, single or multiple bolus doses
conc2mol

Convert concentration to molar
convert_albumin_unit

Convert albumin from / to units
convert_bilirubin_unit

Convert bilirubin from / to units
pk_2cmt_inf_cmin_ss

Cmin (trough) for 2-compartmental PK model, bolus dosing at steady state
pk_2cmt_bolus_cmax_ss

Cmax for 2-compartmental PK model, bolus dosing at steady state
convert_conc_unit

Convert concentration units
print.nca_output

Print function for output from nca()
pct_bmi_for_age

Percentile BMI for age for children
read_who_table

Read WHO growth tables
relative2absolute_bsa

Convert quantity expressed relative to BSA to absolute units
nca_linear

NCA core function to perform linear trapezoid calculations for post-infusion
weight2kg

Convert any weight unit to kg
pk_1cmt_bolus_ss

Concentration predictions for 1-compartmental PK model with bolus dosing at steady state
pk_1cmt_inf

Concentration predictions for 1-compartmental PK model after single or multiple bolus doses
inch2cm

Convert inch to cm
pk_1cmt_inf_dose_from_cmin

Calculate dose to achieve steady state trough for 1-compartmental PK model with infusion dosing at steady state
pk_1cmt_bolus_dose_from_cmax

Calculate dose to achieve steady state Cmax for 1-compartmental PK model bolus dosing at steady state
pk_1cmt_bolus_dose_from_cmin

Calculate dose to achieve steady state trough for 1-compartmental PK model bolus dosing at steady state
pk_1cmt_inf_ss

Concentration predictions for 2-compartmental PK model with infusion dosing at steady state
%<=%

Less-than-or-equal-to with a little room for floating point precision issues
nca_trapezoid

NCA core function to perform log-linear trapezoid calculations for post-infusion
pk_2cmt_inf_dose_from_cmax

Calculate dose to achieve steady state Cmax for 2-compartmental PK model with infusion dosing at steady state
pk_1cmt_bolus_cmax_ss

Cmax for linear 1-compartment PK model at steady state, bolus dosing
pk_2cmt_bolus_cmin_ss

Cmin (trough) for 2-compartmental PK model, bolus dosing at steady state
pk_1cmt_bolus_cmin_ss

Cmin (trough) for linear 1-compartment PK model at steady state, bolus dosing
remove_lt_gt

Remove less-than/greater-than symbols and convert to numeric
calc_kgfr

Calculate kinetic GFR
pk_2cmt_inf_dose_from_cmin

Calculate dose to achieve steady state trough for 2-compartmental PK model with infusion dosing at steady state
valid_units

Valid units
time_to_ss

Time to steady state In either time units or number of doses
pk_2cmt_inf_ss

Concentration predictions for 2-compartmental PK model with infusion dosing at steady state
find_nearest_interval

Generic function to calculate the interval nearest to a possible dosing interval
fraction_of_ss

Calculate fraction of steady state at particular time after start of dosing
pct_height_for_age

Percentile height for age for children
%>=%

Greater-than-or-equal-to with a little room for floating point precision issues
find_nearest_dose

Generic function to calculate the dose nearest to a specific dose unit increment
pk_1cmt_oral

Concentration predictions for 1-compartmental oral PK model after single or multiple bolus doses
pk_2cmt_inf

Concentration predictions for 2-compartmental PK model, single or multiple infusions
pk_1cmt_t12

Calculate terminal half-life for 1-compartment model
pct_for_age_generic

Percentile height or weight for age for children
pk_2cmt_inf_cmax_ss

Cmax (trough) for 2-compartmental PK model, bolus dosing at steady state
pk_2cmt_t12

Calculate half-life(s) for 2-compartment model
pk_2cmt_bolus_dose_from_cmax

Calculate dose to achieve steady state Cmax for 2-compartmental PK model bolus dosing at steady state
pk_2cmt_t12_interval

Calculate average half-life for 2-compartment model during a specific interval
add_ruv

Add residual variability to data
calc_amts_for_conc

Calculate the amounts in all compartments in a compartmental PK system based on a given concentration in the central compartment, and assuming steady state.
calc_bmi

Calculate BMI
calc_baseline_scr

Calculate baseline sCr
auc2dose

Convert AUCtau or AUCt to dose (for 1-compartment linear PK model)
accumulation_ratio

Calculate accumulation ratio This is the ratio of drug concentration or AUC at steady state over concentrations after single dose
calc_abw

Calculate adjusted body weight (ABW)
as.num

factors or characters to numeric
calc_aki_stage

Calculate AKI stage
absolute2relative_bsa

Convert quantity expressed in absolute units relative to normalized BSA
calc_ibw

Calculate ideal body weight in kg for children and adults
calc_creat_neo

Estimate serum creatinine in neonates
calc_egfr

Calculate eGFR
calc_egfr_cystatin

Calculate eGFR based on Cystatin C measurements
calc_bsa

Calculate body surface area
calc_dosing_weight

Calculate commonly used "dosing weight"
calc_carboplatin_calvert

Calvert equation for carboplatin
calc_kel_double_tdm

Calculate elimination rate when given two TDM samples