relation.rd
To calculate the relation between two codings, given the coding indexes.
relation(index1, index2)
index1 | The first coding index, it is length-2 integer vector with the first element (index1[1]) less than the second element (index1[2]). |
---|---|
index2 | The second coding index, it is length-2 integer vector with the first element (index2[1]) less than the second element (index2[2]). |
The relation between two codings can be any one of inclusion, overlap, exact (special case of inclusion and overlap) and proximity (Neither overlap nor inclusion). It should be noted that two adjacent codings are regarded as proximity with distance of 0.
A 6-element list:
Length-1 character, standing for the type of relation. It may be one of inclusion, overlap, exact or proximity.
Length-2 vector, the index of overlapping between two coding indexes. It is c(NA,NA) when relation is proximity.
Length-2 vector, the index of union of the two coding indexes. It is c(NA,NA) when relation is proximity.
Distance of two coding indexes. It is NA when relation is not proximity.
Which argument (index1 or index2) has the minimum value. If both have the same minmum value, return NA.
Which argument (index1 or index2) has the maximum value. If both have the same maxmum value, return NA.
HUANG Ronggui