Learn R Programming

pooledpeaks (version 1.1.1)

ClusterFromSamples: Cluster From Samples

Description

Perform clustering on samples of loci from a data frame and calculate statistics.

Usage

ClusterFromSamples(datafile = data.frame, numloci = 5, reps = 100)

Value

A matrix containing statistics calculated from the clustering results.

Arguments

datafile

A data frame containing the input data must be in LoadData style LoadData.

numloci

An integer specifying the number of loci to sample.

reps

An integer specifying the number of repetitions.

Examples

Run this code
genetic_data <- data.frame(
Locus = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2),
Locus_allele = c("Marker1", "n", 1, 2, 3, "Marker2", "n", 1, 2, 3),
Sample1 = c(NA, 10, 0.5, 0.5, 0, NA, 10, 0.2, 0.3, 0.5),
Sample2 = c(NA, 20, 0.1, 0.2, 0.7, NA, 20, 0.3, 0.4, 0.3),
Sample3 = c(NA, 30, 0.3, 0.4, 0.3, NA, 30, 0.4, 0.2, 0.4)
)

ClusterFromSamples(datafile=genetic_data, numloci=5, reps=10)

Run the code above in your browser using DataLab