Skip to contents

Compares two datasets, summarizing numeric, factor, character, binary, date, and group-specific fields. Handles single dataset analysis or comparison between two datasets.

Usage

compare_df(
  old_data,
  new_data = NULL,
  suffix_term = "",
  ind_outcomes = c(""),
  group_col,
  add_years = FALSE
)

Arguments

old_data

Dataframe containing the base dataset for comparison

new_data

Optional dataframe to compare against old_data. If NULL, only old_data is analyzed

suffix_term

Character string to append to parsed column names (default: "")

ind_outcomes

Character vector of individual outcomes to summarize (default: "")

group_col

Required character string specifying the grouping variable column name

add_years

Logical indicating whether to include year-based summaries (default: FALSE)

Value

A list containing:

numeric_join

Numeric field comparisons

factor_join

Factor level comparisons

char_join

Character field comparisons

bin_join

Binary field comparisons

date_join

Date field comparisons

group_join

Group-specific comparisons

Each component may be NULL if that type of data is not present.