caffsim
R package: Simulation of Plasma Caffeine Concentrations by Using Population Pharmacokinetic ModelSimulate plasma caffeine concentrations using population pharmacokinetic model described in Lee, Kim, Perera, McLachlan and Bae (2015) and the package was published .
pkgdown
:
http://asancpt.github.io/caffsiminstall.pacakges("devtools")
devtools::install_github("asancpt/caffsim")
# Simply create single dose dataset
caffsim::caffPkparam(Weight = 20, Dose = 200, N = 20)
# Simply create multiple dose dataset
caffsim::caffPkparamMulti(Weight = 20, Dose = 200, N = 20, Tau = 12)
library(caffsim)
MyDataset <- caffPkparam(Weight = 20, Dose = 200, N = 20)
head(MyDataset)
MyConcTime <- caffConcTime(Weight = 20, Dose = 200, N = 20)
head(MyConcTime)
caffPlot(MyConcTime)
cowplot
package is required#install.packages("cowplot") # if you don't have it
library(cowplot)
MyPlotPub <- lapply(
c(seq(100, 800, by = 100)),
function(x) caffPlotMulti(caffConcTime(20, x, 20)) +
theme(legend.position="none") +
labs(title = paste0("Single Dose ", x, "mg")))
plot_grid(MyPlotPub[[1]], MyPlotPub[[2]],
MyPlotPub[[3]], MyPlotPub[[4]],
MyPlotPub[[5]], MyPlotPub[[6]],
MyPlotPub[[7]], MyPlotPub[[8]],
labels=LETTERS[1:8], ncol = 2, nrow = 4)
MyDatasetMulti <- caffPkparamMulti(Weight = 20, Dose = 200, N = 20, Tau = 12)
head(MyDatasetMulti)
MyConcTimeMulti <- caffConcTimeMulti(Weight = 20, Dose = 200, N = 20, Tau = 12, Repeat = 10)
head(MyConcTimeMulti)
caffPlotMulti(MyConcTimeMulti)
cowplot
package is required#install.packages("cowplot") # if you don't have it
library(cowplot)
MyPlotMultiPub <- lapply(
c(seq(4, 32, by = 4)),
function(x) caffPlotMulti(caffConcTimeMulti(20, 250, 20, x, 15)) +
theme(legend.position="none") +
labs(title = paste0("q", x, "hr" )))
plot_grid(MyPlotMultiPub[[1]], MyPlotMultiPub[[2]],
MyPlotMultiPub[[3]], MyPlotMultiPub[[4]],
MyPlotMultiPub[[5]], MyPlotMultiPub[[6]],
MyPlotMultiPub[[7]], MyPlotMultiPub[[8]],
labels=LETTERS[1:8], ncol = 2, nrow = 4)
caffShiny()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.