Skip to contents

This function writes a csv file called "dispersal_table.csv" which contains the dispersal variables for each pair of populations to be used as input for the function gl.sim.WF.run.

The values of the variables can be modified using the columns "transfer_each_gen" and "number_transfers" of this file.

See documentation and tutorial for a complete description of the simulations. These documents can be accessed by typing in the R console: browseVignettes(package="dartR”)

Usage

gl.sim.create_dispersal(
  number_pops,
  dispersal_type = "all_connected",
  number_transfers = 1,
  transfer_each_gen = 1,
  outpath = tempdir(),
  outfile = "dispersal_table.csv",
  verbose = NULL
)

Arguments

number_pops

Number of populations [required].

dispersal_type

One of: "all_connected", "circle" or "line" [default "all_connected"].

number_transfers

Number of dispersing individuals. This value can be . modified by hand after the file has been created [default 1].

transfer_each_gen

Interval of number of generations in which dispersal occur. This value can be modified by hand after the file has been created [default 1].

outpath

Path where to save the output file. Use outpath=getwd() or outpath='.' when calling this function to direct output files to your working directory [default tempdir(), mandated by CRAN].

outfile

File name of the output file [default 'dispersal_table.csv'].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2, unless specified using gl.set.verbosity].

Value

A csv file containing the dispersal variables for each pair of populations to be used as input for the function gl.sim.WF.run.

See also

gl.sim.WF.run

Other simulation functions: gl.sim.WF.run(), gl.sim.WF.table()

Author

Custodian: Luis Mijangos -- Post to https://groups.google.com/d/forum/dartr

Examples

gl.sim.create_dispersal(number_pops=10)
#> Starting gl.sim.create_dispersal 
#>   The dispersal table is saved as:  /tmp/RtmpMqupE6/dispersal_table.csv/
#> Completed: gl.sim.create_dispersal 
#>