Defines a new population in a genlight object for specified individuals
Source:R/gl.define.pop.r
gl.define.pop.Rd
The script reassigns existing individuals to a new population and removes their existing population assignment.
The script returns a genlight object with the new population assignment.
Arguments
- x
Name of the genlight object containing SNP genotypes [required].
- ind.list
A list of individuals to be assigned to the new population [required].
- new
Name of the new population [required].
- verbose
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity].
Author
Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr
Examples
popNames(testset.gl)
#> [1] "EmmacBrisWive" "EmmacBurdMist" "EmmacBurnBara" "EmmacClarJack"
#> [5] "EmmacClarYate" "EmmacCoopAvin" "EmmacCoopCully" "EmmacCoopEulb"
#> [9] "EmmacFitzAllig" "EmmacJohnWari" "EmmacMaclGeor" "EmmacMaryBoru"
#> [13] "EmmacMaryPetr" "EmmacMDBBowm" "EmmacMDBCond" "EmmacMDBCudg"
#> [17] "EmmacMDBForb" "EmmacMDBGwyd" "EmmacMDBMaci" "EmmacMDBMurrMung"
#> [21] "EmmacMDBSanf" "EmmacNormJack" "EmmacNormLeic" "EmmacNormSalt"
#> [25] "EmmacRichCasi" "EmmacRoss" "EmmacRussEube" "EmmacTweeUki"
#> [29] "EmsubRopeMata" "EmvicVictJasp"
gl <- gl.define.pop(testset.gl, ind.list=c('AA019073','AA004859'),
new='newguys')
#> Starting gl.define.pop
#> Processing genlight object with SNP data
#> Warning: genlight object contains monomorphic loci
#> Assigned listed individuals AA019073, AA004859 to new population newguys
#> Completed: gl.define.pop
#>
popNames(gl)
#> [1] "EmmacBrisWive" "EmmacBurdMist" "EmmacBurnBara" "EmmacClarJack"
#> [5] "EmmacClarYate" "EmmacCoopAvin" "EmmacCoopCully" "EmmacCoopEulb"
#> [9] "EmmacFitzAllig" "EmmacJohnWari" "EmmacMDBBowm" "EmmacMDBCond"
#> [13] "EmmacMDBCudg" "EmmacMDBForb" "EmmacMDBGwyd" "EmmacMDBMaci"
#> [17] "EmmacMDBMurrMung" "EmmacMDBSanf" "EmmacMaclGeor" "EmmacMaryBoru"
#> [21] "EmmacMaryPetr" "EmmacNormJack" "EmmacNormLeic" "EmmacNormSalt"
#> [25] "EmmacRichCasi" "EmmacRoss" "EmmacRussEube" "EmmacTweeUki"
#> [29] "EmsubRopeMata" "EmvicVictJasp" "newguys"
indNames(gl)[pop(gl)=='newguys']
#> [1] "AA019073" "AA004859"