Ensure one-to-one mapping of the two specified vectors.

one_to_one_mapping(name, id, ext = "_")

Arguments

name

A character vector. If no one-to-one mapping exists, the values of this vector will be changed (by extending with ext)!

id

A vector, preferably for identifiers. This column will not be touched in case of a disagreement.

ext

The extension character.

Value

The vector name, where one to one mapping for the two vectors is ensured.

Details

First checks if every unique value in name corresponds with a unique value in id. If not, changes the disagreeing values in name by extending the label with the ext character and a number.