relabel: Change labels of populations or samples

Description Usage Arguments Value Examples

View source: R/eigenstrat.R

Description

Replace population/sample names with specified group labels.

Usage

1
relabel(data, ..., outfile = tempfile(fileext = ".ind"))

Arguments

data

EIGENSTRAT trio.

...

Population/sample names to merge (each new group defined as a character vector).

outfile

Path to an output snp file with coordinates of excluded sites.

Value

Updated S3 EIGENSTRAT data object with an additional 'group' slot specifying the path to a new ind file. #'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: # download an example genomic data set and prepare it for analysis
snps <- eigenstrat(download_data(dirname = tempdir()))

# group individual samples into larger populations, creating a new
# EIGENSTRAT R object
new_snps <- relabel(
    snps,
    European = c("French", "Sardinian"),
    African = c("Dinka", "Yoruba", "Mbuti", "Khomani_San"),
    Archaic = c("Vindija", "Altai", "Denisova")
)

## End(Not run)

admixr documentation built on July 8, 2020, 6:19 p.m.