Den: Compare Groups Based on Density Plots

Description Usage Arguments Value Author(s) Examples

View source: R/statVisual.R

Description

Compare groups based on density plots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Den(
    data, 
    y, 
    group = NULL, 
    fill = group, 
    border.color = NULL, 
    inner.color = NULL, 
    theme_classic = TRUE, 
    xlab = y, 
    ylab = "density", 
    group.lab = group, 
    title = "Density plot", 
    alpha = 0.3, 
    addThemeFlag = TRUE,
    ...)

Arguments

data

A data frame. Rows are subjects; Columns are variables describing the subjects.

y

character. The column name of data that indicates the variable, for which the histogram will be drawn. The string y can also indicate a function of the variable, e.g., log(y).

group

character. The column name of data that indicates the subject groups. The density will be drawn for each of the subject group. It also indicates the border colors of the densities.

fill

grouping variable, density inside color

border.color

density border color, only available when group & fill are NULL

inner.color

density inside color, only available when group & fill are NULL

theme_classic

Use classic background without grids (default: FALSE)

xlab

x axis label

ylab

y axis label

group.lab

label of group variable

title

title of plot

alpha

transparency of density inside color

addThemeFlag

logical. Indicates if light blue background and white grid should be added to the figure.

...

other input parameters for facet & theme

Value

A list with 9 elements. data, layers, scales, mapping, theme, coordinates, facet, plot_env, and labels.

Author(s)

Wenfei Zhang <Wenfei.Zhang@sanofi.com>, Weiliang Qiu <Weiliang.Qiu@sanofi.com>, Xuan Lin <Xuan.Lin@sanofi.com>, Donghui Zhang <Donghui.Zhang@sanofi.com>

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
data(esSim)
print(esSim)

# expression data
dat = exprs(esSim)
print(dim(dat))
print(dat[1:2,])

# phenotype data
pDat = pData(esSim)
print(dim(pDat))
print(pDat[1:2,])

# feature data
fDat = fData(esSim)
print(dim(fDat))
print(fDat[1:2,])

# choose the first probe which is over-expressed in cases
pDat$probe1 = dat[1,]

# check histograms of probe 1 expression in cases and controls
print(table(pDat$grp, useNA = "ifany"))

statVisual(type = 'Den', 
           data = pDat, 
           y = 'probe1', 
           group = 'grp') 

Den( 
    data = pDat, 
    y = 'probe1', 
    group = 'grp') 

statVisual documentation built on Feb. 21, 2020, 1:08 a.m.