dt.rm.dup: Removes duplicated column content from a data.table.

dt.rm.dupR Documentation

Removes duplicated column content from a data.table.

Description

Removes duplicated column content from a data.table.

Usage

dt.rm.dup(DT, ignore = NULL)

Arguments

DT

A data.table.

ignore

A character or integer vector specifying columns that should be ignored during duplication removal.

Value

A data.table.

Author(s)

Yoann Pageaud.

Examples

dtbl<-data.table(
  col1 = rep(x = c("hello", "world"), 8),
  col2 = rep(x = c("hello", "world"), 8)) #'col2' is a duplicate of 'col1'.
dt.rm.dup(DT = dtbl) #Only 'col1' remains.
#You can ignore specific columns that will not be remove if duplicated:
dt.rm.dup(DT = dtbl,ignore = "col2")

YoannPa/DTrsiv documentation built on Nov. 28, 2022, 5:44 p.m.