powered by
data_diff_groups() is a wrapper around diff_groups() that runs the same analysis on two variables in a data frame and adds selected results back as new columns.
data_diff_groups()
diff_groups()
data_diff_groups( data, input_vars, output_vars = c(is_common = "is_common", diff_1_2 = "diff_1_2", diff_2_1 = "diff_2_1", sum_1_2 = "sum_1_2", sum_2_1 = "sum_2_1"), ... )
A data frame identical to data, but with additional variables describing relationships between the two specified columns.
data
A data frame containing the variables to be compared.
Character vector of length two specifying the names of the two variables in data to be compared.
Named character vector defining which variables from the group results are added to data, and what their names will be in the output.
Additional arguments passed to diff_groups().
df <- cbind(v1 = 1, SSBtoolsData("code_pairs"), v4 = 4) data_diff_groups(df, input_vars = c("code_1", "code_2"))
Run the code above in your browser using DataLab