Skip to contents

Creates an ID that contains information on the parties to an agreement, the type of agreement, the date and the linkage to other agreements in the dataset.

Usage

code_agreements(dataset = NULL, title, date)

Arguments

dataset

dataset name. If provided without a title and date variables, the function finds title and date conforming columns in the dataset. The function "expects" that there are variables named Title and Signature that they have been standardised using standardise_titles() and messydates::as_messydate(), respectively.

title

title variable. The function "expects" that the variable has been standardised using standardise_titles()

date

date variable. The function "expects" that the variable has been standardised using messydates::as_messydate().

Value

a character vector with the treatyIDs

Examples

# \donttest{
IEADB <- dplyr::slice_sample(manyenviron::agreements$IEADB, n = 10)
code_agreements(dataset = IEADB)
#>  Title and date conforming columns in dataset automatically found
#>  Coded agreement parties
#>  Coded agreement type
#>  Coded known agreements
#>  Coded agreement dates
#>  Coded acronyms for agreements
#>  Coded agreement linkages
#> 0 entries were not matched at all.
#> There were 0 duplicated IDs.
#>  Please run `vignette('agreements')` for more information.
#>  [1] "ACEWNH_2001E2"      "CPRAEM_2005P"       "ESP-PRT[RDE]_1964A"
#>  [4] "PRPLBS_1986P"       "KAZ-KGZ[DCR]_2000A" "CRI-MCO[MEP]_2004A"
#>  [7] "DEU-NAM[FOW]_2000A" "GR15TU_2010A"       "CTMHWD_1995E"      
#> [10] "TC07ML_1977A"      
code_agreements(title = IEADB$Title, date = IEADB$Signature)
#>  Coded agreement parties
#>  Coded agreement type
#>  Coded known agreements
#>  Coded agreement dates
#>  Coded acronyms for agreements
#>  Coded agreement linkages
#> 0 entries were not matched at all.
#> There were 0 duplicated IDs.
#>  Please run `vignette('agreements')` for more information.
#>  [1] "ACEWNH_2001E2"      "CPRAEM_2005P"       "ESP-PRT[RDE]_1964A"
#>  [4] "PRPLBS_1986P"       "KAZ-KGZ[DCR]_2000A" "CRI-MCO[MEP]_2004A"
#>  [7] "DEU-NAM[FOW]_2000A" "GR15TU_2010A"       "CTMHWD_1995E"      
#> [10] "TC07ML_1977A"      
# }