average_runs: average_runs

Description Usage Arguments Details Value Author(s) Examples

Description

This function averages across replications of STRUCTURE for a given value of K. Note that in this implementation, the user must ensure that the clusters to be averaged are in the same order across the listed deStruct objects.

Usage

1
average_runs(deStruct_list)

Arguments

deStruct_list

a list of the deStruct objects to be averaged

Details

Note that the objects in deStruct_list should be listed using list(), not c(), so that each deStruct object is an element in the list.

Value

an object of the class deStruct

Author(s)

Marlee Labroo & Joyce Njuguna

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#import paths of the example structure files installed
mypath <- system.file("extdata", "myresults_default50000k2r1_f", package = "deStructure")
mypath2 <- system.file("extdata", "myresults_default50000k2r2_f", package = "deStructure")
mypath3 <- system.file("extdata", "myresults_default50000k2r3_f", package = "deStructure")

#import the example structure files with deStruct
k2r1 <- deStruct(mypath)
k2r2 <- deStruct(mypath2)
k2r3 <- deStruct(mypath3)

#Since the clusters in these files are already consistently ordered, list and average them.
k2_list <- list(k2r1, k2r2, k2r3)
k2_ave <- average_runs(k2_list)

labroo2/deStructure documentation built on May 8, 2019, 8:58 p.m.