View source: R/distinct_cols.R
distinct_cols | R Documentation |
Select only unique columns
distinct_cols(.data, keep = NA, reverse = FALSE)
.data: |
a dataframe whose columns will be evaluated for uniqueness and then have duplicates removed |
keep: |
a vector of quoted column names for columns that should be kept regardless of duplicate status. Defaults to NA |
reverse: |
should columns be evaluated for duplicates in reverse order? Defaults to FALSE |
a dataframe with only unique columns
mtcars2 <- mtcars %>% mutate(hp2 = hp)
mtcars2 %>% distinct_cols()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.