convert.mig.trajectories | R Documentation |
Converts trajectories of the net migration rates stored in a binary format into two CSV files.
convert.mig.trajectories(
sim.dir = NULL,
n = 1000,
output.dir = NULL,
verbose = FALSE
)
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. |
The function creates two files. First, “ascii_trajectories.csv” is a comma-separated table with the following columns:
country code
prediction interval, e.g. 2015-2020
middle year of the prediction interval
identifier of the trajectory
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.
No return value.
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.
convert.tfr.trajectories
,
mig.write.projection.summary
, get.mig.trajectories
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.