This function takes 3d arrays of blocked f2, allele frequency products, and counts, splits them by population pair, and writes each pair to a separate .rds file under {outdir}/{pop1}/{pop2}.rds.

write_f2(est_arr, count_arr, outdir, id = "f2", overwrite = FALSE)

Arguments

est_arr

A 3d array with blocked f2, allele frequency products, or fst estimates for each population pair. The first two dimensions of each array have to have population names.

count_arr

A 3d array of the same dimension with counts

outdir

Directory where data will be stored

id

Postfix showing the type of statistic ("f2", "ap", or "fst")

overwrite

Overwrite existing files in outdir

See also

Examples

if (FALSE) {
write_f2(f2_arr, count_arr, outdir = 'path/to/f2stats/')
}