get_matched_columns_based_on_value | R Documentation |
Detect pairs of columns with same unique values (order does not matter) in two dataframes.
get_matched_columns_based_on_value(
df1,
df2,
only_allow_one_match = F,
treat_fully_contain_as_identical = T
)
df1 |
Dataframe1 |
df2 |
Dataframe2 |
only_allow_one_match |
Default FALSE. This parameters is designed to get only one pair of matched columns between two dataframes to supply as parameters for merge function (when TRUE). |
A dataframe containing names of matched columns. Or a vetor containing names of matched columns
when only_allow_one_match
is TRUE
and there do have one match.
vec1 <- data.frame(col1=c('a','a','b','d'), a=c(1,2,3,4))
vec2 <- data.frame(col2=c('d','d','a','b'), b=c(1,2,4,5),a=c(1,2,3,4))
get_matched_columns_based_on_value(vec1, vec2)
# match_1 match_2
# DF1 col1 a
# DF2 col2 a
vec2 <- data.frame(col2=c('d','d','a','b'))
get_matched_columns_based_on_value(vec1, vec2)
# match_1
# DF1 col1
# DF2 col2
get_matched_columns_based_on_value(vec1, vec2, only_allow_one_match = T)
# "col1" "col2"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.