Learn R Programming

MoBPS (version 1.13.1)

get.pca: Principle components analysis

Description

Function to perform a principle component analysis

Usage

get.pca(
  population,
  path = NULL,
  database = NULL,
  gen = NULL,
  cohorts = NULL,
  id = NULL,
  coloring = "group",
  components = c(1, 2),
  plot = TRUE,
  pch = 1,
  export.color = FALSE,
  use.id = FALSE
)

Value

Principle components of gen/database/cohorts selected individuals

Arguments

population

Population list

path

Location were to save the PCA-plot

database

Groups of individuals to consider for the export

gen

Quick-insert for database (vector of all generations to export)

cohorts

Quick-insert for database (vector of names of cohorts to export)

id

Individual IDs to search/collect in the database

coloring

Coloring by "group", "sex", "plain"

components

Default: c(1,2) for the first two principle components

plot

Set to FALSE to not generate a plot

pch

Point type in the PCA plot

export.color

Set to TRUE to export the per point coloring

use.id

Set TRUE to display IDs instead of dots in the PCA plot

Examples

Run this code
data(ex_pop)
get.pca(ex_pop, gen=2)

Run the code above in your browser using DataLab