I have two datasets, one with 71 columns and one with 12 columns. Each dataset has columns, which are not columns in the other dataset. How can I automatically create a list of the columns, which are part of dataset 1, but are not part of dataset 2 and vice versa?
Thanks!
CodePudding user response:
setdiff(colnames(df1), colnames(df2))
and
setdiff(colnames(df2), colnames(df1))