Skip to contents

Different treatyIDs generated for different datasets might have minor differences in terms of acronym or linkage. Some minor differences in treatyIDs could mean different treatyIDS in different datasets actually refer to the same agreement. The function finds these occurences and returns the first treatyID argument entered as a replacement.

Usage

condense_agreements(database = NULL, var = NULL)

Arguments

database

A "many" package database

var

Two or more treatyID variables

Value

A dataframe of treatyID and treatyID references

Examples

data1 <- data.frame(treatyID = c("CPV-PRT[FSD]_1980A",
"CPV-PRT[FSD]_1990P:FSD_1980A",
"TD06LJ_1981A", "RAMSA_1971A", "WIIEWH_1982P"))
data2 <- data.frame(treatyID = c("TD06LJ_1981A", "RAMSA_1971A",
"WIIEWH_1982P:RAMSA_1971A",
"PRTRPC_1976A", "PRTRPC_1983E1:PRTRPC_1976A"))
manyID <- condense_agreements(var = c(data1$treatyID, data2$treatyID))
data1 <- merge(data1, manyID)
data2 <- merge(data2, manyID)