Write a reference data frame to gsi_sim format baseline and repunits file
Source:R/write_gsi_sim_reference.R
write_gsi_sim_reference.RdNote, this is only intended to work with integer-valued alleles, at the moment. It was just written for testing and verifying that things are working correctly.
Usage
write_gsi_sim_reference(
ref,
gen_start_col,
baseout = "baseline.txt",
repout = "repunits.txt"
)Examples
# create a temp directory to put example outputs
dd <- tempdir()
basefile <- file.path(dd, "baseline.txt")
repunitsfile <- file.path(dd, "repunits.txt")
# print those
basefile
#> [1] "/var/folders/ln/5brnn1wx0vj58fhlbbdjm8h40000gp/T//RtmpRAg5Gu/baseline.txt"
repunitsfile
#> [1] "/var/folders/ln/5brnn1wx0vj58fhlbbdjm8h40000gp/T//RtmpRAg5Gu/repunits.txt"
# note that in practice you will probably want to specify
# your own filepaths...
# run the function
write_gsi_sim_reference(alewife, 17, basefile, repunitsfile)