plotNCAParametersCorrelation
[PKanalix] Correlation between NCA individual parameters.
Plot the correlation between NCA individual parameters.
Usage
plotNCAParametersCorrelation(
parametersRows = NULL,
parametersColumns = NULL,
settings = list(),
preferences = NULL,
stratify = list()
)
Arguments
- parametersRows
(vector) vector with the names of NCA parameters to display on rows (by default the first 4 computed parameters are displayed).
- parametersColumns
(vector) vector with the names of NCA parameters to display on columns (by default parametersColumns = parametersRows).
- settings
List with the following settings:
regressionLine
(logical) If TRUE, regression line is displayed (default TRUE).spline
(logical) If TRUE, spline is displayed (default FALSE).legend
(logical) If TRUE, plot legend is displayed (default FALSE).grid
(logical) If TRUE, plot grid is displayed (default TRUE).ncol
(integer) number of columns when usingsplit
(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("plotNCAParametersCorrelation") 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.color
(vector) - Vector of covariates used for coloring (by default no coloring is applied). Coloring applies to dots of plots w.r.t continuous covariates, but not on histograms or boxplots. For instancec("FORM","AGE")
.colors
- Vector of colors to use whencolor
argument is used. Takes precedence over colors defined inpreferences
. For instancec("#ebecf0","#cdced1","#97989c")
.
Value
A ggplot object if
parametersRows
andparametersColumns
have only one elementA TableGrob object if multiple plots (output of grid.arrange)
See also
Examples
initializeLixoftConnectors(software = "pkanalix")
project <- file.path(getDemoPath(), "/2.case_studies/project_Theo_extravasc_SD.pkx")
loadProject(project)
runNCAEstimation()
# by default only the 4 first NCA parameters are shown
plotNCAParametersCorrelation()
#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
# choosing to display only a subset of possible covariates and NCA parameters (same param on rows and columns)
plotNCAParametersCorrelation(parametersRows = c("Cmax","Lambda_z","AUCINF_obs"))
#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
# selecting different parameters on rows and columns
plotNCAParametersCorrelation(parametersRows = c("AUCINF_obs","Cmax"),
parametersColumns = c("Lambda_z","Tmax"))
#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
# changing the settings to choose which elements to display
plotNCAParametersCorrelation(settings = list(regressionLine=F,
spline=T,
legend=T,
grid=F,
units=F,
fontsize=8))
#> 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 (appearance of the elements)
plotNCAParametersCorrelation(parametersRows = c("Cmax","Lambda_z"),
settings=list(legend=T, spline=T),
preferences = list(obs=list(color="#202120",
radius=2,
shape=18,
legend="NCA parameter values"),
regressionLine=list(color="#202120",
lineWidth=1,
lineType="dashed",
legend="Linear regression line"),
spline=list(color="#97989c",
lineWidth=1,
lineType="solid",
legend="Spline regression line")))
#> 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]
# split each plot into two subplot for FORM=ref and FORM=test, vertically (ncol=1)
plotNCAParametersCorrelation(parametersRows = c("Cmax","Lambda_z","AUCINF_obs"),
settings=list(ncol=1),
stratify = list(split=c("FORM")))
#> TableGrob (1 x 1) "arrange": 1 grobs
#> z cells name grob
#> 1 1 (1-1,1-1) arrange gtable[arrange]
# define groups for AGE and HT, color by HT and filter by AGE
plotNCAParametersCorrelation(settings=list(legend=T),
parametersRows = c("Cmax","Lambda_z"),
stratify = list(groups=list(list(name="AGE", definition=c(30, 35)),
list(name="HT", definition=c(184.5))),
color="HT",
colors=c("#cdced1","#161617"),
filter=list("AGE",c(1,3))))
#> 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]
# filter to keep only second sequence (TR) and FORM=test
plotNCAParametersCorrelation(settings=list(legend=T),
parametersRows = c("Cmax","Lambda_z"),
stratify = list(filter=list(list("SEQ",2),list("FORM","test"))))
#> 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]