plot_density_3D: Visualization of 3D Density of various groups on Principal...

Description Usage Arguments Details Value Author(s) Examples

View source: R/plot_density_3D.R

Description

This function displays density of individuals from various groups created by create_group(). This wraps "persp" from package "graphics" and thus takes additional graphical input shown in example.

Usage

1
2
3
plot_density_3D(name, Assay, group, PC1 = 1,
PC2 = 2, static = FALSE,
gridsize = 100, groupinfo = NULL, ...)

Arguments

name

Name of the "PCA" object containing the assay data

Assay

Name of an Assay

group

Names of a group

PC1, PC2

Numbers corresponding to the principal components on which density is to be calculated

static

Logical if TRUE a static plot is generated. default = FALSE

gridsize

A number used in kernel smoothing. default is 100

groupinfo

Same as integrate_variables()

...

additional arguments passed to base function "persp" from package "graphics"

Details

2D density is calculated using the "kde2d"" function from package "MASS"" which use kernel density estimation (KDE) to calculate density of 2D data. If the variance on either or both of the PCs are 0, the KDE can't be calculated.

Value

Displays 3D density plots of PCs

Author(s)

Subhadeep Das <subhadeep1024@gmail.com>

Examples

1
2
3
4
5
6
7
8
PCAlist <- integrate_variables(Assays = c("H2az"),
name = multi_assay,
groups = c("WE","RE"), groupinfo = groupinfo_ext,
scale.unit = FALSE, graph = FALSE)

plot_density_3D(name = PCAlist, Assay = "H2az",
group = "WE", PC1 = 1, PC2 = 2, grid_size = 100,
static = FALSE, groupinfo = groupinfo_ext)

subhadeep1024/OMICsPCA documentation built on March 17, 2020, 5:23 p.m.