.check_uniqueness {eq5dsuite}R Documentation

Check the uniqueness of groups This function takes a data frame 'df' and a vector of columns 'group_by', and checks whether the combinations of values in the columns specified by 'group_by' are unique. If the combinations are not unique, a warning message is printed.

Description

Check the uniqueness of groups This function takes a data frame 'df' and a vector of columns 'group_by', and checks whether the combinations of values in the columns specified by 'group_by' are unique. If the combinations are not unique, a warning message is printed.

Usage

.check_uniqueness(df, group_by)

Arguments

df

A data frame.

group_by

A character vector of column names in 'df' that specify the groups to check for uniqueness.

Value

No return value, called for side effects: it will stop with an error if any group combinations are not unique.

Examples

df <- data.frame(id = c(1, 1, 1, 1, 2, 2),
                 fu = rep(c("baseline", "follow-up"), 3),
                 value = rnorm(6))
.check_uniqueness(df, c("id", "fu"))

[Package eq5dsuite version 1.0.0 Index]