Learn R Programming

mcmodule (version 1.2.0)

add_group_id: Add Group Identifiers to Data Frame

Description

Adds group IDs for matching and alignment between data frames.

Usage

add_group_id(x, y = NULL, by = NULL)

Value

Data frame or list of data frames with added group identifiers (g_id, g_row).

Arguments

x

(data frame). First dataset.

y

(data frame, optional). Second dataset. If provided, aligns with x. Default: NULL.

by

(character vector, optional). Column names for grouping. If NULL, auto-detected from categorical columns. Default: NULL.