Learn R Programming

clinCompare (version 1.0.0)

compare_variables: Compare Variables of Two Datasets

Description

Compares the structural attributes of two datasets including column names, data types, and variable ordering. Identifies common columns and reports columns that exist in only one dataset.

Usage

compare_variables(df1, df2)

Value

A list containing variable comparison details and discrepancy count.

Arguments

df1

A data frame representing the first dataset.

df2

A data frame representing the second dataset.

Examples

Run this code
# \donttest{
  df1 <- data.frame(id = 1:3, name = c("A", "B", "C"))
  df2 <- data.frame(id = 1:3, name = c("A", "B", "C"), score = c(90, 80, 70))
  compare_variables(df1, df2)
# }

Run the code above in your browser using DataLab