plottable.dapc: Components plottable Creates a list with two logical data...

View source: R/DAPC_adegenet.R

plottable.dapcR Documentation

Components plottable Creates a list with two logical data frames, the first with K vs. DF, and the second with K vs. PC, with TRUE values indicating that it is possible to make a density plot for K=rowname(m) vs. DF=colname(n).

Description

Components plottable

Creates a list with two logical data frames, the first with K vs. DF, and the second with K vs. PC, with TRUE values indicating that it is possible to make a density plot for K=rowname(m) vs. DF=colname(n).

Usage

plottable.dapc(x)

Arguments

x

list of DAPC objects

Value

Returns a list with two data frames, each with rownames indicating K for which density can be plotted (because smallest cluster size has > 1 individual). Columns show names of discriminat functions (first data frame) or principle components (second data frame). Values are TRUE or FALSE. The function is useful for creating layout matrices for plotting all possible density plots.

Examples

library(misc.wrappers)
# Define path to example input VCF containing 5000 variants and 100 individuals.
vcf.path <- file.path(system.file("extdata", package = "misc.wrappers"),"example.vcf.gz")

# Simulate a dataset of 1000 variants and 50 individuals in one population, and save the simulated dataset in the current directory as "example_simulated_K2.vcf.gz"
simK2 <- sim.vcf(x=vcf.path,save.as="example_simulated_K2.vcf.gz",n.ind=100,n.snps=1000,K=2)

# Simulate a dataset of 1000 variants and 50 individuals in one population, and save the simulated dataset in the current directory as "example_simulated_K3.vcf.gz"
simK3<- sim.vcf(x=vcf.path,save.as="example_simulated_K3.vcf.gz",n.ind=100,n.snps=1000,K=3)

# Simulate a dataset of 1000 variants and 50 individuals in one population, and save the simulated dataset in the current directory as "example_simulated_K4.vcf.gz"
simK4 <- sim.vcf(x=vcf.path,save.as="example_simulated_K4.vcf.gz",n.ind=100,n.snps=1000,K=4)

JeffWeinell/misc.wrappers documentation built on Sept. 20, 2023, 12:42 p.m.