plot_pred | R Documentation |
Display individual and population predictions (IPRED and PRED) profiles versus observation dots over time for a given number of subjects (sampled or selected through filters).
plot_pred(object, filterr = "", covs = F, n = 20, pred = T,
ylog = T, xlog = F, freeScale = F, plotly = F, LOQ = "")
object |
peccary object, namely a run or a folder, generally through a folder function (with one or several run numbers). |
filterr |
string or NSE, directly through a R code (for instance "IPRED > 3 & dose %in% c(100, 200)", with or without quotes). Works with IPRED, PRED, OBS, TIME, YTYPE and any covariate (included ID). This filter is secondly reworked so too complex filters can lead to errors - notably filters like (A & B) | (C & D)... |
covs |
string, name of the covariate the user want to discriminate trough different colors. Works only for a single run (method not implemented for folders). |
n |
numeric, number of maximal plots represented. If the number of possible ID is above this value, a sampling process is applied. |
pred |
bool, display (or not) prediction profiles in dashed lines. |
ylog |
bool, if true (by default) a logarithmic y axis is applied, if false an ordinary one. |
xlog |
bool, if true a logarithmic x axis is applied, if false (by default) an ordinary one. |
plotly |
bool, if true toggle a dynamic plot, if false (by default) display a static plot. |
LOQ |
numeric, manually provide a LLOQ value. Every point below or equal to this value will be displayed with a different shape. A horitonzal dashed line will also be printed. |
freescale |
bool, if true every ID will have its personnal axis, if false shared axis will be used. |
Returns a ggplot object (which can be reworked, see example)
Thibaud Derippe (Thibaud.Derippe@gmail.com)
## Not run:
# folder creation
folder <- createFolder("path_to_initial_folder")
# Basic plot_pred
plot_pred(folder(1), covs = "Dose", n = 25, LOQ = 10 )
# Applying a filter for a console peccary use:
plot_pred(folder(3:4), IPRED > 0.1 & x_cov == "y")
# Equivalent to (for shiny app purpose mostly):
plot_pred(folder(3:4), "IPRED > 0.1 & x_cov == \"y\"")
# Created plot can be manually modified:
plot_pred(folder(1)) +
ggtitle("Peccary is a beautifull animal") +
theme_dark() +
labs(x = "region", y = "peccary fertility")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.