mutate_auto_coalesce | R Documentation |
When joining data, there are often column conflicts. Coalescing is the most common solution. This function attempts to identify the conflicting column names after a join, coalesces them into the base name, and drops the suffixed versions.
mutate_auto_coalesce(data, suffix = c(".x", ".y"))
data |
the data resulting from a join operation |
suffix |
the suffixes used to disambiguate non-joined duplicate variables during the join |
a dataframe with duplicate variables coalesced and the original variants dropped
x <- data.frame(id = 1:3, v = paste0("x", 1:3))
y <- data.frame(id = 2:4, v = paste0("y", 2:4))
d <- dplyr::left_join(x, y, by = "id")
mutate_auto_coalesce(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.