Learn R Programming

RClone (version 1.0.3)

export_genclone: export data file to Adegenet, Genetix and Arlequin

Description

These functions allow to transform a RClone table into files to work with Adegenet (R package), Genetix and Arlequin softwares.

Usage

export_genclone_genind(data1, ele)
export_genclone_genetix(data1, haploid = FALSE, ele, name)
export_genclone_arlequin(data1, haploid = FALSE, name)

Arguments

data1

a RClone table with only one population.

haploid

logical, option, if haploid = FALSE, data1 contains diploid data; if haploid = TRUE, haploid data.

ele

option, separator element for export.

name

option, name of the exported file.

Value

a genind object or a file for Genetix or Arlequin.

Examples

Run this code
# NOT RUN {

# }
# NOT RUN {

data(posidonia)

#RClone to Adegenet:
res <- export_genclone_genind(posidonia, "/")
#library(adegenet)
#res2 <- df2genind(res, ploidy = 2, sep = "/")
#nAll(res2)

#RClone to Genetix:
export_genclone_genetix(posidonia, name = "test.txt")
#or
write.table(export_genclone_genetix(posidonia), "test2.txt", row.names = FALSE, 
sep = "\t", quote = FALSE)
#for genets only:
export_genclone_genetix(unique(posidonia), name = "test.txt")

#Rclone to Arlequin:
write.table(export_genclone_arlequin(posidonia), "file1.arp", row.names = FALSE,
 col.names = FALSE, quote = FALSE)
#or
export_genclone_arlequin(posidonia, haploid = FALSE, "file2.arp")
#for genets only:
export_genclone_arlequin(unique(posidonia), haploid = FALSE, "file2.arp")

#if several populations:
#res <- split(data, vecpop)
#lapply(res, function(x) export_genclone_genetix(x))
#lapply(res, function(x) export_genclone_arlequin(x))

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab