na.omitValByDupPK: Omit 'NA's in values for duplicated registers by PK and...

View source: R/primaryKey.R

na.omitValByDupPKR Documentation

Omit NAs in values for duplicated registers by PK and return a data.frame with a unique register for each PK if possible.

Description

Omit NAs in values for duplicated registers by PK and return a data.frame with a unique register for each PK if possible.

Usage

na.omitValByDupPK(x, pk, collapse)

Arguments

x

a data.frame

pk

columns with the primary key

collapse

a character. If no missing, duplicated values are collapsed in a string separated by collapse character.

Value

Return x removing duplicated rows by PK omitting NAs. If collapse is missing, duplicated rows by PK and different values are kept.


jmaspons/dbTools documentation built on March 10, 2024, 7:30 p.m.