Learn R Programming

randPedPCA (version 1.1.2)

plot3DWithProj: 3D plot of PC scores with projections on coordinate planes

Description

3D plot of PC scores with projections on coordinate planes

Usage

plot3DWithProj(
  pc,
  dims = c(1, 2, 3),
  plotProj = TRUE,
  grid = TRUE,
  col = 1,
  ff = 0.5,
  theta = -45,
  phi = 25
)

Value

nothing

Arguments

pc

An rppca object

dims

integer vector, which PCs to plot, defauts to 1:3

plotProj

logical, whether to plot the projections

grid

logical, wheter to plot grids

col

the dot colours, integer or string, scalar or vector

ff

numeric, offset for projection (proportion of the orthogonal axis's range)

theta, phi

polar coordinates in degrees. theta rotates round the vertical axis. phi rotates round the horizontal axis.

Examples

Run this code
ped <- pedigree(pedMeta$fid,
pedMeta$mid,
pedMeta$id
)
pc <- rppca(ped)
plot3DWithProj(pc, col=as.numeric(factor(pedMeta$population)))

Run the code above in your browser using DataLab