make_history: Creates a list of event for a country

Description Usage Arguments Details Examples

View source: R/make_history.R

Description

From a text file (see prerequisite), make a list of a list of 4 or 6 elements for each event (see Details).

Usage

1
make_history(file, hash, d.hash)

Arguments

file

txt file containing the information (try should be written in a specific format, see details)

hash

named vector to translate the name of the admin1 geographic unit

d.hash

named vector to translate the name of the admin2 geographic unit

Details

From a text file (see prerequisite), make a list of event (list of 4 or 6 elements):

  1. 'year': date of event in character,

  2. 'event': character either split, merge or rename,

  3. 'before': name of the admin1(s) before the event in a list and

  4. 'after': name of the admin1(s) after the event in a list

  5. 'd.before' : name of the admin2s concerned by the event (only for complex event)

  6. 'd.after' : name of the admin2s concerned by the event (only for complex event)



In the file .txt, each event should be written in a specific format: "In DATE, ADMIN1(s) (ADMIN2(s)) EVENT in ADMIN1(s).".
ADMIN1(s): if multiple, separated by ";"
If the details of the split/merge event is available at admin2 level, the admin2 should be written in (), separated by "," and the event should be written complex EVENT.
DATE: written by year as "YYYY" or can be a full date written as "YYYY-mm_dd"
EVENT: choose betwrepreen: split(s)/merge/rename(s)
For example: In 1992, Hau Giang splits in Can Tho; Soc Trang.
For example: In 2013, Vientiane (Longsan, Xaysomboun, Phun, Hom); Xiengkhuang (Thathon) complex splits in Xaisomboun.

Examples

1
2
3
4
5
## Not run: 
 library(dictionary)
 make_history("path/to/file.txt", vn_admin1)

## End(Not run)

choisy/dictionary documentation built on Aug. 21, 2019, 3:52 p.m.