Description Usage Arguments Details Value Author(s) Examples
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.
1 | average_runs(deStruct_list)
|
deStruct_list |
a list of the deStruct objects to be averaged |
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.
an object of the class deStruct
Marlee Labroo & Joyce Njuguna
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.