renameDuplicated: Rename vector to avoid duplicated values with another vector

View source: R/utils.R

renameDuplicatedR Documentation

Rename vector to avoid duplicated values with another vector

Description

Renames values by adding an index to the end of duplicates. This allows to prepare unique values in two vectors before a merge, for instance.

Usage

renameDuplicated(check, comp)

Arguments

check

Character: values to rename if duplicated

comp

Character: values to compare with

Value

Character vector with renamed values if duplicated; else, it returns the usual values. It does not return the comparator values.

Examples

psichomics:::renameDuplicated(check = c("blue", "red"), comp = c("green",
                                                                 "blue"))

nuno-agostinho/psichomics documentation built on Feb. 11, 2024, 11:16 p.m.