The function groups the samples per subcontinental population and generates a matrix containing the sample identifiers and where each column is a subcontinental population.

splitSelectByPop(dataRef)

Arguments

dataRef

a data.frame containing those columns:

sample.id

a character string representing the sample identifier.

pop.group

a character string representing the subcontinental population assigned to the sample.

superPop

a character string representing the super-population assigned to the sample.

Value

a matrix containing the sample identifiers and where each column is the name of a subcontinental population. The number of row corresponds to the number of samples for each subcontinental population.

Author

Pascal Belleau, Astrid Deschênes and Alexander Krasnitz

Examples


## A data.frame containing samples from 2 subcontinental populations
demo <- data.frame(sample.id=c("SampleA", "SampleB", "SampleC", "SampleD"),
    pop.group=c("TSI", "TSI", "YRI", "YRI"),
    superPop=c("EUR", "EUR", "AFR", "AFR"))

## Generate a matrix populated with the sample identifiers and where
## each row is a subcontinental population
splitSelectByPop(dataRef=demo)
#>      TSI       YRI      
#> [1,] "SampleA" "SampleC"
#> [2,] "SampleB" "SampleD"