plotBESubjectByFormulation
[PKanalix] Plot subject-by-formulation
Plot the Bioequivalence parameters as Subject-by-formulation.
Usage
plotBESubjectByFormulation(
parameters = NULL,
formulations = NULL,
settings = list(),
preferences = NULL,
stratify = list()
)
Arguments
- parameters
(vector) vector of NCA parameters (included in BE calculations) to display. (by default the first 4 computed parameters are displayed).
- formulations
(vector) vector of test (i.e non-ref) formulations to display. (by default the first 4 test formulations are displayed).
- settings
List with the following settings:
dots
(logical) If TRUE, NCA parameters are displayed as dots (default TRUE).lines
(logical) If TRUE, NCA parameters belonging to the same individual are connected by lines (default TRUE).legend
(logical) If TRUE, plot legend is displayed (default FALSE).grid
(logical) If TRUE, plot grid is displayed (default TRUE).ylog
(logical) If TRUE, log-scale on y axis is used (default TRUE).ncol
(logical) Number of columns to arrange the subplots (default 4).fontsize
(integer) Font size of text elements (default 11).units
(logical) If TRUE, units are added in axis labels (default TRUE).
- preferences
(optional) preferences for plot display, run getPlotPreferences("plotBESubjectByFormulation") to check available options.
- stratify
List with the stratification arguments:
groups
- Definition of stratification groups. By default, stratification groups are already defined as one group for each category for categorical covariates, and two groups of equal number of individuals for continuous covariates. To redefine groups, for each covariate to redefine, specify a list with:name character covariate name (e.g "AGE"
)definition vector(continuous) || list>(categorical) For continuous covariates, vector of break values (e.g c(35, 65)
). For categorical covariates, groups of categories as a list of vectors(e.glist(c("study101"), c("study201","study202"))
)split
(vector) - Vector of covariates used to split (i.e facet) the plot (by default no split is applied). For instancec("FORM","AGE")
.filter
(list< list> >) - List of pairs containing a covariate name and the vector of indexes or categories (for categorical covariates) of the groups to keep (by default no filtering is applied). For instance,list("AGE",c(1,3))
to keep the individuals belonging to the first and third age group, according to the definition ingroups
. For instance,list("FORM","ref")
using the category name for categorical covariates.
Value
A ggplot object if only one parameter is given in
parameters
A TableGrob object if multiple plots (output of grid.arrange)
See also
Examples
initializeLixoftConnectors(software = "pkanalix")
project <- file.path(getDemoPath(), "/3.bioequivalence/project_crossover_bioequivalence.pkx")
loadProject(project)
runNCAEstimation()
runBioequivalenceEstimation()
# display by default
plotBESubjectByFormulation()

#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
# select only a subplot of parameters used for BE analysis
# if several test formulations are compared w.r.t a reference formulation, it is also possible to select which test formulation to display
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
formulations = c("test"))

#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
# changing the settings
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
settings=list(dots=T,
lines=T,
legend=T,
grid=F,
ylog=T,
units=F,
fontsize=9))

#> TableGrob (2 x 1) "arrange": 2 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
#> 2 2 (2-2,1-1) arrange gtable[guide-box]
# changing the preferences
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
settings=list(legend=T),
preferences = list(formulationDot=list(color="#202120",
radius=4,
shape=18,
legend="NCA parameter for each formulation"),
formulationLine=list(color="#202120",
lineWidth=0.5,
lineType="dashed",
legend="Individuals")))

#> TableGrob (2 x 1) "arrange": 2 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
#> 2 2 (2-2,1-1) arrange gtable[guide-box]
# define groups of WT and split by WT
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
stratify=list(groups=list(name="WT", definition=c(70)),
split=c("WT")))

#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
# define groups of AGE and WT and filter by AGE and WT
plotBESubjectByFormulation(parameters = c("AUCINF_obs","Cmax"),
stratify=list(groups=list(list(name="WT", definition=c(70)),
list(name="AGE", definition=c(24,34))),
filter=list(list("AGE",c(1,3)),
list("WT",2))))

#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]