eta_distribution_plot: Eta distribution plots

Description Usage Arguments Value Examples

View source: R/pmx-plots-distibution.R

Description

Eta distribution plots

Eta Distribution boxplot

Eta Distribution histogram plot

Usage

1
2
3
4
5
6
7
8
9
eta_distribution_plot(jitter, type, dname, is.shrink, shrink, is.jitter,
  histogram, 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, ...)

pmx_plot_eta_box(ctr, ...)

pmx_plot_eta_hist(ctr, ...)

Arguments

jitter

list set jitter parameter

type

box for boxplot or histogram

dname

name of dataset to be used

is.shrink

logical if TRUE add shrinkage layer

shrink

list list of parameters to tune the shrinkage

is.jitter

logical if TRUE add jitter operator for points

histogram

list histogram graphical parameters

pmx_update parameters

filter

expression filter which will be applied to plotting data.

strat.facet

formula optional stratification parameter by facetting. This split plot by strats(each strat in a facet)

facets

list facet_wrap parameters.

strat.color

character optional stratification parameter by grouping. This will split the plot by group (color) of strat.

trans

character define the transformation to apply on x or y or both variables

pmxgpar

a object of class pmx_gpar possibly the output of the

pmx_gpar: Shared basic graphics parameters

labels

list list containing plot and/or axis labels: title, subtitle, x , y

axis.title

list containing element_text attributes to customize the axis title. (similar to ggplot2 axis.title theme)

axis.text

list containing element_text attributes to customize the axis text (similar to ggplot2 axis.text theme)

ranges

list limits of x/y ranges

is.smooth

logical if set to TRUE add smooth layer

smooth

list geom_smooth graphical/smoothing fun parameters

is.band

logical if TRUE add horizontal band

band

list horizontal band parameters. geom_hline graphical parameters.

is.draft

logical if TRUE add draft layer

draft

list draft layer parameters. geom_text graphical parameters.

is.identity_line

logical if TRUE add an identity line

identity_line

listgeom_abline graphical parameters.

scale_x_log10

logical if TRUE use log10 scale for x axis.

scale_y_log10

logical if TRUE use log10 scale for y axis.

color.scales

list define scales parameter in case of strat.color pmx_settings

...

others graphics parameters passed :

  • pmx_gpar internal function to customize shared graphical parameters

  • distrib generic object for distribution plots (histogram/boxplot).

  • pmx_update function.

distrib parameters

ctr

pmx controller

Value

ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# *************** basic use ***************** ------

ctr <- theophylline()
## boxplot variation
p <- ctr %>% pmx_plot_eta_box
## histogram variation
p <- ctr %>% pmx_plot_eta_hist()

# update graphical parameter  ----------------------

## add jitter
ctr %>% 
  pmx_plot_eta_hist(is.jitter = TRUE, jitter = list(alpha = 0.4, color = "red"))

## remove shrinkage
ctr %>% 
  pmx_plot_eta_hist(is.shrink = FALSE)

## updat histogram graphical parameters
ctr %>% 
  pmx_plot_eta_hist(
    histogram = list(
      color = NA, 
      position = "fill", 
      binwidth = 1 / 100)
    )



# stratification  ----------------------------------

## categorical stratification color parameter
ctr %>% pmx_plot_eta_hist(is.jitter=TRUE,strat.facet=~STUD,strat.color="SEX")
## categorical stratification facetting
ctr %>% pmx_plot_eta_hist(strat.facet = "SEX")
## using formula categorical stratification facetting
ctr %>% pmx_plot_eta_hist(strat.facet = STUD~SEX,
                         shrink=list(hjust=0.5))

# subsetting  --------------------------------------

## select a set of random effect
ctr %>% pmx_plot_eta_hist(filter = EFFECT %in% c("ka", "Cl"))
## filter and stratify by facets
ctr %>% pmx_plot_eta_hist(
  filter = EFFECT %in% c("ka", "Cl"), strat.facet = "SEX"
)
ctr %>% pmx_plot_eta_hist(
  filter = EFFECT %in% c("ka", "Cl"), strat.facet = "SEX"
)

ggPMXdevelopment/ggPMX documentation built on March 6, 2020, 10:26 p.m.