check_key | R Documentation |
Accepts a column key dataframe and checks to make sure it has the needed structure for ltertools::harmonize
. Also removes unnecessary columns and rows that lack a "tidy_name". Function invoked 'under the hood' by ltertools::harmonize
.
check_key(key = NULL)
key |
(dataframe) key object including a "source", "raw_name" and "tidy_name" column. Additional columns are allowed but ignored |
(dataframe) key object with only "source", "raw_name" and "tidy_name" columns and only retains rows where a "tidy_name" is specified.
# Generate a column key object manually
key_obj <- data.frame("source" = c(rep("df1.csv", 3),
rep("df2.csv", 3)),
"raw_name" = c("xx", "unwanted", "yy",
"LETTERS", "NUMBERS", "BONUS"),
"tidy_name" = c("numbers", NA, "letters",
"letters", "numbers", "kingdom"))
# Check it
ltertools::check_key(key = key_obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.