View source: R/dataframe_tools.R
diff_cols | R Documentation |
Unlike same_cols()
, the order of l
and r
does matter for diff_cols()
.
diff_cols(l, r, side = "both")
l |
(Dataframe) A dataframe whose column names to compare. |
r |
(Dataframe) A dataframe whose column names to compare. |
side |
(Character) |
A Character vector with the names of missing columns.
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"
diff_cols(iris1, iris2)
#> [1] "Sepal.Length" "Petal.Width" "Species"
diff_cols(iris1, iris2, side = "l")
#> [1] "Sepal.Length"
diff_cols(iris1, iris2, side = "r")
#> [1] "Petal.Width" "Species"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.