convert.mig.trajectories {bayesMig} | R Documentation |
Converting Trajectories of Migration Rates into ACSII Files
Description
Converts trajectories of the net migration rates stored in a binary format into two CSV files.
Usage
convert.mig.trajectories(
sim.dir = NULL,
n = 1000,
output.dir = NULL,
verbose = FALSE
)
Arguments
sim.dir |
Directory containing the prediction object. It should be the same as
the |
n |
Number of trajectories to be stored. It can be either a single number or the word “all” in which case all available trajectories are converted. If the number is smaller than the number of trajectories available in the prediction object, they are selected by equal spacing. |
output.dir |
Directory into which the resulting files will be stored.
If it is |
verbose |
Logical value. Switches log messages on and off. |
Details
The function creates two files. First, “ascii_trajectories.csv” is a comma-separated table with the following columns:
- “LocID”:
country code
- “Period”:
prediction interval, e.g. 2015-2020
- “Year”:
middle year of the prediction interval
- “Trajectory”:
identifier of the trajectory
- “mig”:
net migration rate
The second file is called “ascii_trajectories_wide.csv”, also a comma-separated table and it contains the same information as above but in a wide format. I.e. the data for one country are ordered in columns, thus, there is one column per country. The country columns are ordered alphabetically.
If the prediction object has been adjusted via any of the adjustment functions, the exported trajectories are also adjusted.
Value
No return value.
Note
This function is automatically called from the mig.predict
function, therefore in standard cases it will not be needed to call it directly.
However, it can be useful for example, if different number of trajectories are to be converted,
without having to re-run the prediction, or if the trajectories were adjusted.
See Also
convert.tfr.trajectories
,
mig.write.projection.summary
, get.mig.trajectories