Individual plot
pmx_plot_individual(
ctr,
which_pages = 1L,
print = FALSE,
dname,
pred_line,
ipred_line,
point,
is.legend,
use.finegrid,
bloq,
filter,
strat.facet,
facets,
strat.color,
trans,
pmxgpar,
labels,
axis.title,
axis.text,
ranges,
is.smooth,
smooth,
is.band,
band,
is.draft,
draft,
is.identity_line,
identity_line,
scale_x_log10,
scale_y_log10,
color.scales,
...
)
ggplot2 or list of ggplot2 objects
pmx controller
integer
page(s) to display, or character
"all" to display all pages (argument previously called npage, now deprecated)
logical
if TRUE the ouptut will be a print not a ggplot2. This
is useful for rmarkdwon output to avoid verbose list index print.
character
name of dataset to be used. User can create his own
dataset using set_data
and pass it as dname to be plotted.
list
some ipred line geom properties aesthetics
list
some pred line geom properties aesthetics
list
some point geom properties aesthetics
logical
if TRUE add a legend
logical
if FALSE use predictions data set
pmxBLOQ
object created by pmx_bloq
.
pmx_update parameters
expression
filter which will be applied to plotting data.
formula
optional stratification parameter by facetting.
This split plot by strats(each strat in a facet)
list
facet_wrap parameters.
character
optional stratification parameter by grouping.
This will split the plot by group (color) of strat.
character
define the transformation to apply on x or y or both variables
a object of class pmx_gpar possibly the output of the
pmx_gpar: Shared basic graphics parameters
list
list containing plot and/or axis labels: title, subtitle, x , y
list
containing element_text attributes to customize
the axis title. (similar to ggplot2 axis.title theme)
list
containing element_text attributes to customize
the axis text (similar to ggplot2 axis.text theme)
list
limits of x/y ranges
logical
if set to TRUE add smooth layer
list
geom_smooth graphical/smoothing fun parameters
logical
if TRUE add horizontal band
list
horizontal band parameters. geom_hline graphical parameters.
logical
if TRUE add draft layer
list
draft layer parameters. geom_text graphical parameters.
logical
if TRUE add an identity line
list
geom_abline graphical parameters.
logical
if TRUE use log10 scale for x axis.
logical
if TRUE use log10 scale for y axis.
list
define scales parameter in case of strat.color pmx_settings
others graphics parameters passed :
pmx_gpar
internal function to customize shared graphical parameters
individual
generic object for individual plots.
pmx_update
function.
individual parameters
# basic use ---------------------------------------
# \donttest{
ctr <- theophylline()
ctr %>% pmx_plot_individual(which_pages = 1)
## multiple pages
ctr %>% pmx_plot_individual(which_pages = c(1, 3))
## change faceting
ctr %>% pmx_plot_individual(facets = list(nrow = 5, ncol = 5), which_pages = 2)
# update graphical parameter ----------------------
## update labels
ctr %>% pmx_plot_individual(
labels = list(title = "Custom individual plot")
)
## remove draft
ctr %>% pmx_plot_individual(is.draft = FALSE)
## Customize ipred_line with any geom_line parameter
ctr %>% pmx_plot_individual(
pred_line = list(color = "red", linetype = 20, alpha = 0.5)
)
## Customize ipred_line with any geom_line parameter
ctr %>% pmx_plot_individual(
ipred_line = list(size = 5)
)
## Customize any geom_point parameter
ctr %>% pmx_plot_individual(
point = list(aes(alpha = DV), color = "green", shape = 4)
)
## legend
p <- ctr %>% pmx_plot_individual(
is.legend=TRUE,
point=list(shape=20),
pred_line=list(linetype=6)
)
# # stratification ----------------------------------
#
# ## continuous stratification
ctr %>% pmx_plot_individual(strat.color = "WT0")
# # subsetting --------------------------------------
#
# ## we can use any expression involving the data
# ## filter and stratify
ctr %>% pmx_plot_individual(
filter = SEX == 1, strat.facet = ~SEX,
facets = list(nrow = 5, ncol = 5))
# # transformation --------------------------------------
#
# ## apply a log transformation in y
ctr %>% pmx_plot_individual(trans = "log10_y")
# ## apply a custonm trsnformation to normalize axis between 0 and 1
## get a list of parameter
p <- ctr %>% pmx_plot_individual(
which_pages="all",
point=list(shape=4,color='blue',size=10),
facets = list(nrow = 5, ncol = 5),
labels = list(title = "My individuals",x='my time',y='PD data')
)
# }
Run the code above in your browser using DataLab