Introduction

To run the tests, the package must be installed with its tests:

Testing and validation that results match in a local environment compared to the original environment is an important part of confirmation that a package works as expected.

Re-running this vignette in your local environment will confirm that local results match those in the original package development. Test success is confirmed by the existence of no failed tests; warnings are expected during testing (and not shown in this vignette for that reason); and some tests may be skipped, but those are expected as well.

Summary of Testing

The following sentence is dynamically generated to summarize the testing results: All tests passed.

Testing Log

Interval columns

Testing Filename Test Description Number of Tests Number of Failed Tests
test-001-add.interval.col.R add.interval.col 16 0

AIC.list testing

Testing Filename Test Description Number of Tests Number of Failed Tests
test-AIC.list.R AIC.list 5 0
test-AIC.list.R get.first.model 15 0
test-AIC.list.R get.best.model 1 0

AUC and AUMC

Testing Filename Test Description Number of Tests Number of Failed Tests
test-auc.R pk.calc.auxc 9 0
test-auc.R pk.calc.auc 94 0
test-auc.R pk.calc.auc.last 2 0
test-auc.R pk.calc.auc.inf 2 0
test-auc.R pk.calc.auc.all 2 0
test-auc.R pk.calc.aumc 3 0
test-auc.R pk.calc.aumc.inf 2 0
test-auc.R pk.calc.aumc.all 2 0
test-auc.R pk.calc.aumc.last 2 0
test-auc.R pk.calc.auc.inf.pred 1 0
test-auc.R pk.calc.aumc.inf.obs 1 0
test-auc.R pk.calc.aumc.inf.pred 1 0

aucint

Testing Filename Test Description Number of Tests Number of Failed Tests
test-aucint.R AUCint gives errors appropriately 18 0
test-aucint.R AUCint gives the same value when no interpolation/extrapolation is required 3 0
test-aucint.R AUCint gives a warning and NA when it cannot interpolate or extrapolate a value 4 0
test-aucint.R AUCint respects auc.type and does the correct calculations for each AUC type 9 0
test-aucint.R aucint respects doses 3 0
test-aucint.R aucint works with infinite intervals 4 0

AUC interval checking

Testing Filename Test Description Number of Tests Number of Failed Tests
test-check.intervals.R check.interval.specification 24 0
test-check.intervals.R check.interval.deps 1 0
test-check.intervals.R get.parameter.deps 5 0
test-check.intervals.R check.intervals requires a valid value 1 0

Determining tau for AUCs

Testing Filename Test Description Number of Tests Number of Failed Tests
test-choose-intervals.R find.tau 16 0
test-choose-intervals.R choose.auc.intervals 10 0

Class generation-general

Testing Filename Test Description Number of Tests Number of Failed Tests
test-class-general.R getColumnValueorNot 3 0
test-class-general.R setAttributeColumn 19 0
test-class-general.R getAttributeColumn 10 0
test-class-general.R getDataName.default returns NULL 4 0

Class generation-PKNCAconc

Testing Filename Test Description Number of Tests Number of Failed Tests
test-class-PKNCAconc.R PKNCAconc 12 0
test-class-PKNCAconc.R PKNCAconc with input other than data.frames 1 0
test-class-PKNCAconc.R model frame and parameter extractions 12 0
test-class-PKNCAconc.R split.PKNCAconc 5 0
test-class-PKNCAconc.R print.PKNCAconc 3 0
test-class-PKNCAconc.R summary.PKNCAconc 1 0
test-class-PKNCAconc.R PKNCAconc with exclusions 1 0
test-class-PKNCAconc.R PKNCAconc with duration 1 0
test-class-PKNCAconc.R PKNCAconc with nominal time added 2 0
test-class-PKNCAconc.R PKNCAconc with volume added 3 0

Class generation-PKNCAdata

Testing Filename Test Description Number of Tests Number of Failed Tests
test-class-PKNCAdata.R PKNCAdata 10 0
test-class-PKNCAdata.R PKNCAdata with no or limited dose information 4 0
test-class-PKNCAdata.R print.PKNCAdata 3 0
test-class-PKNCAdata.R summary.PKNCAdata 1 0
test-class-PKNCAdata.R splitting PKNCAdata 1 0
test-class-PKNCAdata.R no intervals auto-determined (Fix GitHub issue #84) 3 0
test-class-PKNCAdata.R Ensure that unexpected arguments to PKNCAdata give an error (related to issue #83) 1 0
test-class-PKNCAdata.R intervals may be a tibble 1 0

Class generation-PKNCAdose

Testing Filename Test Description Number of Tests Number of Failed Tests
test-class-PKNCAdose.R PKNCAdose 12 0
test-class-PKNCAdose.R PKNCAdose without a data.frame as input 1 0
test-class-PKNCAdose.R PKNCAdose model.frame 13 0
test-class-PKNCAdose.R print.PKNCAdose 4 0
test-class-PKNCAdose.R PKNCAdose with exclusions 1 0
test-class-PKNCAdose.R PKNCAdose route and duration 6 0
test-class-PKNCAdose.R time.nominal within PKNCAdose 3 0
test-class-PKNCAdose.R setDuration 3 0

Class generation-PKNCAresults

Testing Filename Test Description Number of Tests Number of Failed Tests
test-class-PKNCAresults.R PKNCAresults generation 8 0
test-class-PKNCAresults.R PKNCAresults has exclude, when applicable 3 0
test-class-PKNCAresults.R PKNCAresults summary 6 0
test-class-PKNCAresults.R dropping start and end from groups is allowed with a warning. 2 0
test-class-PKNCAresults.R summary.PKNCAresults manages exclusions as missing not as non-existent. 3 0
test-class-PKNCAresults.R print.summary_PKNCAresults works 1 0
test-class-PKNCAresults.R ptr works as a parameter 1 0
test-class-PKNCAresults.R exclude values are maintained in derived parameters during automatic calculation (#112) 3 0
test-class-PKNCAresults.R ctrough is correctly calculated 1 0

Missing and BLQ data cleaners

Testing Filename Test Description Number of Tests Number of Failed Tests
test-cleaners.R clean.conc.na 19 0
test-cleaners.R clean.conc.blq 27 0

exclude_nca

Testing Filename Test Description Number of Tests Number of Failed Tests
test-exclude_nca.R exclude_nca 9 0

exclude

Testing Filename Test Description Number of Tests Number of Failed Tests
test-exclude.R setExcludeColumn 14 0
test-exclude.R exclude.default 17 0
test-exclude.R normalize_exclude makes blanks into NA_character_ 3 0

Check Conversion

Testing Filename Test Description Number of Tests Number of Failed Tests
test-general.functions.R check.conversion 3 0

Check concentration and time inputs

Testing Filename Test Description Number of Tests Number of Failed Tests
test-general.functions.R check.conc.time 13 0

Rounding to string values

Testing Filename Test Description Number of Tests Number of Failed Tests
test-general.functions.R Rounding 21 0
test-general.functions.R Significance 33 0
test-general.functions.R signifString stops when bad arguments are passed 1 0
test-general.functions.R max_na and min_na 8 0

Half-life

Testing Filename Test Description Number of Tests Number of Failed Tests
test-half.life.R pk.calc.half.life 11 0
test-half.life.R half-life manual point selection 5 0
test-half.life.R two-point half-life succeeds (fix #114) 2 0

Interpolation and extrapolation of concentration

Testing Filename Test Description Number of Tests Number of Failed Tests
test-interpolate.conc.R extrapolate.conc 25 0
test-interpolate.conc.R interpolate.conc 32 0
test-interpolate.conc.R interp.extrap.conc 5 0
test-interpolate.conc.R interp.extrap.conc.dose handles all eventualities 25 0
test-interpolate.conc.R interp.extrap.conc.dose 26 0

merging lists

Testing Filename Test Description Number of Tests Number of Failed Tests
test-merge.R merge.splitlist 8 0

Formula parsing

Testing Filename Test Description Number of Tests Number of Failed Tests
test-parseFormula.R parseFormula 14 0
test-parseFormula.R formula.parseFormula 11 0
test-parseFormula.R print.parseFormula 4 0
test-parseFormula.R findOperator 31 0

Business rule functions

Testing Filename Test Description Number of Tests Number of Failed Tests
test-pk.business.rules.R geomean 10 0
test-pk.business.rules.R geosd 2 0
test-pk.business.rules.R geocv 2 0
test-pk.business.rules.R business.mean 6 0
test-pk.business.rules.R pk.business 5 0

All NCA calculations

Testing Filename Test Description Number of Tests Number of Failed Tests
test-pk.calc.all.R pk.nca 14 0
test-pk.calc.all.R Calculations when dose time is missing 1 0
test-pk.calc.all.R Calculations when no dose info is given 2 0
test-pk.calc.all.R pk.nca with exclusions 3 0
test-pk.calc.all.R pk.calc.all with duration.dose required 1 0
test-pk.calc.all.R half life inclusion and exclusion 2 0
test-pk.calc.all.R No interval requested (e.g. for placebo) 2 0
test-pk.calc.all.R Volume-related calculations 2 0
test-pk.calc.all.R pk.nca can calculate values with group-level data 1 0
test-pk.calc.all.R Missing dose info for some subjects gives a warning, not a difficult-to-interpret error 2 0
test-pk.calc.all.R Ensure that options are respected during pk.nca call 1 0

C0 Calculations

Testing Filename Test Description Number of Tests Number of Failed Tests
test-pk.calc.c0.R pk.calc.c0 10 0
test-pk.calc.c0.R pk.calc.c0.method.logslope 6 0
test-pk.calc.c0.R pk.calc.c0.method.c0 2 0
test-pk.calc.c0.R pk.calc.c0.method.c1 5 0
test-pk.calc.c0.R pk.calc.c0.method.set0 2 0
test-pk.calc.c0.R pk.calc.c0.method.cmin 2 0

Dose-normalized NCA functions

Testing Filename Test Description Number of Tests Number of Failed Tests
test-pk.calc.dn.R pk.calc.dn 3 0
test-pk.calc.dn.R pk.calc.cmax 1 0

Simple NCA functions

Testing Filename Test Description Number of Tests Number of Failed Tests
test-pk.calc.simple.R adj.r.squared 4 0
test-pk.calc.simple.R pk.calc.cmax 12 0
test-pk.calc.simple.R pk.calc.cmin 12 0
test-pk.calc.simple.R pk.calc.tmax 8 0
test-pk.calc.simple.R pk.calc.tlast 7 0
test-pk.calc.simple.R pk.calc.clast.obs 7 0
test-pk.calc.simple.R pk.calc.thalf.eff 3 0
test-pk.calc.simple.R pk.calc.kel 3 0
test-pk.calc.simple.R pk.calc.cl 7 0
test-pk.calc.simple.R pk.calc.f 9 0
test-pk.calc.simple.R pk.calc.aucpext 13 0
test-pk.calc.simple.R pk.calc.mrt 1 0
test-pk.calc.simple.R pk.calc.mrt.iv 4 0
test-pk.calc.simple.R pk.calc.mrt.md 2 0
test-pk.calc.simple.R pk.calc.vz 13 0
test-pk.calc.simple.R pk.calc.vss and its wrappers 3 0
test-pk.calc.simple.R pk.calc.vd and its wrappers 8 0
test-pk.calc.simple.R pk.calc.cav 3 0
test-pk.calc.simple.R pk.calc.ctrough 4 0
test-pk.calc.simple.R pk.calc.ptr 2 0
test-pk.calc.simple.R pk.calc.tlag 4 0
test-pk.calc.simple.R pk.calc.deg.fluc 2 0
test-pk.calc.simple.R pk.calc.swing 3 0
test-pk.calc.simple.R pk.calc.ceoi 3 0

Urine

Testing Filename Test Description Number of Tests Number of Failed Tests
test-pk.calc.urine.R pk.calc.ae 1 0
test-pk.calc.urine.R pk.calc.clr 3 0
test-pk.calc.urine.R pk.calc.fe 2 0

PKNCA option setting

Testing Filename Test Description Number of Tests Number of Failed Tests
test-PKNCA.options.R PKNCA.options 92 0
test-PKNCA.options.R PKNCA.choose.option 9 0

PKNCA summary setting

Testing Filename Test Description Number of Tests Number of Failed Tests
test-PKNCA.options.R PKNCA.set.summary input checking 13 0
test-PKNCA.options.R PKNCA.set.summary exists for all paramters 1 0
test-PKNCA.options.R PKNCA.options.describe 1 0
test-PKNCA.options.R PKNCA.options fails when setting defaults and another option simultaneously 1 0

Provenance

Testing Filename Test Description Number of Tests Number of Failed Tests
test-provenance.R provenance 10 0

Superposition

Testing Filename Test Description Number of Tests Number of Failed Tests
test-superpostion.R superposition inputs 74 0
test-superpostion.R superposition math 14 0
test-superpostion.R PKNCAconc superposition 1 0

time_calc()

Testing Filename Test Description Number of Tests Number of Failed Tests
test-time_calc.R Numeric time_calc() is successful with all scalar combinations of number and NA and numeric order. 9 0
test-time_calc.R Numeric time_calc() is successful with all vector combinations of number and NA and numeric order. 5 0
test-time_calc.R POSIXt objects work 5 0
test-time_calc.R difftime 4 0

Time to steady-state

Testing Filename Test Description Number of Tests Number of Failed Tests
test-time.to.steady.state.R pk.tss.data.prep 11 0
test-time.to.steady.state.R pk.tss.stepwise.linear 15 0
test-time.to.steady.state.R pk.tss.monoexponential 9 0
test-time.to.steady.state.R pk.tss 7 0

Session Information

## [1] "2020-08-10"
## R version 3.6.2 (2019-12-12)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.4 LTS
## 
## Matrix products: default
## BLAS/LAPACK: /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64_lin/libmkl_gf_lp64.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices datasets  utils     methods   base     
## 
## other attached packages:
## [1] dplyr_1.0.0    testthat_2.3.2 knitr_1.29     PKNCA_0.9.4   
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.5       highr_0.8        compiler_3.6.2   pillar_1.4.6    
##  [5] tools_3.6.2      pkgload_1.1.0    digest_0.6.25    evaluate_0.14   
##  [9] memoise_1.1.0    lifecycle_0.2.0  tibble_3.0.3     nlme_3.1-148    
## [13] lattice_0.20-41  pkgconfig_2.0.3  rlang_0.4.7      cli_2.0.2       
## [17] rstudioapi_0.11  yaml_2.2.1       parallel_3.6.2   pkgdown_1.5.1   
## [21] xfun_0.15        withr_2.2.0      stringr_1.4.0    generics_0.0.2  
## [25] desc_1.2.0       fs_1.4.2         vctrs_0.3.2      rprojroot_1.3-2 
## [29] grid_3.6.2       tidyselect_1.1.0 glue_1.4.1       R6_2.4.1        
## [33] fansi_0.4.1      rmarkdown_2.3    purrr_0.3.4      tidyr_1.1.0     
## [37] magrittr_1.5     backports_1.1.8  htmltools_0.5.0  ellipsis_0.3.1  
## [41] MASS_7.3-51.6    assertthat_0.2.1 renv_0.11.0      stringi_1.4.6   
## [45] crayon_1.3.4