remove_duplicates: For use with tables

View source: R/remove_duplicates.R

remove_duplicatesR Documentation

For use with tables

Description

Turns duplicate rows into NAs

Usage

remove_duplicates(x, keepLast = FALSE)

Arguments

x

Character vector

keepLast

Logical indicating whether the last incidence should be kept instead of the first (which is the default).

Value

A character string/vector

Examples

    x <- c(rep("a", 5), rep("c", 2), rep("y", 7))
    remove_duplicates(x)


EstherHerbert/Useful.functions documentation built on Jan. 31, 2025, 10:41 a.m.