View source: R/dataframe_tools.R
same_cols | R Documentation |
The order of l
and r
doesn't matter for same_cols()
, but
it does for diff_cols()
.
same_cols(l, r)
l |
(Dataframe) A dataframe whose column names to compare. |
r |
(Dataframe) A dataframe whose column names to compare. |
A Character vector with the names of the columns that appear
in both l
and r
.
Desi Quintans (http://www.desiquintans.com)
iris1 <- iris[, 1:3]
colnames(iris1)
#> [1] "Sepal.Length" "Sepal.Width" "Petal.Length"
iris2 <- iris[, 2:5]
colnames(iris2)
#> [1] "Sepal.Width" "Petal.Length" "Petal.Width" "Species"
same_cols(iris1, iris2)
#> [1] "Sepal.Width" "Petal.Length"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.