View source: R/pmx-plots-vpc.R
pmx_plot_vpc | R Documentation |
VPC plot
pmx_plot_vpc(
ctr,
type,
idv,
obs,
pi,
ci,
rug,
bin,
is.legend,
sim_blq,
dname,
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,
is.footnote,
...
)
ctr |
pmx controller |
type |
|
idv |
|
obs |
|
pi |
|
ci |
|
rug |
|
bin |
|
is.legend |
|
sim_blq |
|
dname |
added for compatibility with other ggPMX plots pmx_update parameters |
filter |
|
strat.facet |
|
facets |
|
strat.color |
|
trans |
|
pmxgpar |
a object of class pmx_gpar possibly the output of the pmx_gpar: Shared basic graphics parameters |
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 |
|
is.footnote |
|
... |
others graphics parameters passed :
pmx_vpc parameters |
You can use pmx_vpc_bin to set the bin parameters. In case of stratification,
binning can be different for each strat level (case within_strat
equal to FALSE).
ggplot2 or list of ggplot2 objects
Other vpc:
pmx_vpc_bin()
,
pmx_vpc_ci()
,
pmx_vpc_obs()
,
pmx_vpc_pi()
,
pmx_vpc_rug()
,
pmx_vpc()
library(ggPMX)
theo_path <- file.path(
system.file(package = "ggPMX"), "testdata",
"theophylline"
)
WORK_DIR <- file.path(theo_path, "Monolix")
input_file <- file.path(theo_path, "data_pk.csv")
vpc_file <- file.path(theo_path, "sim.csv")
ctr <- pmx_mlx(
config = "standing",
directory = WORK_DIR,
input = input_file,
dv = "Y",
dvid = "dvid",
cats = c("SEX"),
conts = c("WT0", "AGE0"),
strats = "STUD",
settings = pmx_settings(
use.labels=TRUE,
cats.labels=list(
SEX=c("0"="Male","1"="Female")
)
),
sim = pmx_sim(
file = vpc_file,
irun ="rep",
idv="TIME"
)
)
ctr %>% pmx_plot_vpc(
strat.facet=~SEX,
facets=list(nrow=2),
type="percentile",
is.draft = FALSE,
pi = pmx_vpc_pi(interval = c(0.1,0.9),
median=list(color="green"),
extreme= list(color="green")),
obs = pmx_vpc_obs(color="blue",shape=18,size=2),
ci = pmx_vpc_ci(interval = c(0.1,0.9),
median=list(fill="pink")),
bin=pmx_vpc_bin("kmeans",n=5)
)
ctr %>%
pmx_plot_vpc(bin= pmx_vpc_bin(
style = "fixed",
fixedBreaks=c(-10,2, 5, 10,15,50))
)
# example with legend
ctr %>% pmx_plot_vpc(
is.legend = TRUE,
pi = pmx_vpc_pi(interval=c(0.02,0.98),median = list(linetype="dotted")),
ci = pmx_vpc_ci(interval = c(0.05,0.95),median=list(fill="red"))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.