Skip to contents

Indicates if two data frames have the same column names or not and what the differences are.

Usage

compare_cols(df1, df2)

Arguments

df1, df2

data frames to compare

Value

a named list with 4 elements:

  • same: a logical indicating whether df1 and df2 have the same columns

  • both: a character vector with the column names in both df1 and df2

  • df1_only: a character vector with the column names only in df1

  • df2_only: a character vector with the column names only in df2