vis.pca: PCA result visualisation

Description Usage Arguments Value Examples

Description

Plot the given pca results with colour divided by the given groups.

Usage

1
vis.pca(.data, .groups = NA, .text = T)

Arguments

.data

Result from prcomp() function or a data frame with two columns 'First' and 'Second' stands for the first PC and the second PC.

.groups

List with names for groups and indices of the group members. If NA than each member is in the individual group.

.text

If T than print the names of the subjects.

Value

ggplot object.

Examples

1
2
3
4
5
6
## Not run: 
data(twb)
tmp = geneUsage(twb)
vis.pca(prcomp(t(tmp[,-1])))

## End(Not run)

Example output

Loading required package: ggplot2
Loading required package: dplyr

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Loading required package: gridExtra

Attaching package: 'gridExtra'

The following object is masked from 'package:dplyr':

    combine

Loading required package: reshape2
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:dplyr':

    as_data_frame, groups, union

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

sh: 1: cannot create /dev/null: Permission denied
sh: 1: wc: Permission denied
Could not detect number of cores, defaulting to 1.

Attaching package: 'tcR'

The following object is masked from 'package:igraph':

    diversity

tcR documentation built on July 2, 2020, 3:18 a.m.