View source: R/select_key_cols.R
| select_key_cols | R Documentation |
Default behaviour if neither key_cols nor non_key_cols are provided is to select all columns.
select_key_cols(df, key_cols = NULL, non_key_cols = NULL)
df |
Dataframe to select columns from. |
key_cols |
Columns to select. |
non_key_cols |
Columns to disclude. You cannot provide both |
Dataframe
> a <- tibble(key_1 = numeric(),
key_2 = numeric(),
non_key = numeric())
> select_key_cols(a, key_cols = c("key_1", "key_2"))
# A tibble: 0 × 2
> select_key_cols(a, non_key_cols = "non_key")
# A tibble: 0 × 2
… with 2 variables: key_1 <dbl>, key_2 <dbl>
> select_key_cols(a, key_cols = c("key_1", "key_2"), non_key_cols = "non_key")
Error in select_key_cols(a, key_cols = c("key_1", "key_2"), non_key_cols = "non_key") :
You can define which variables should be checked for completeness by setting 'key_cols'
or which variables should be discluded by setting 'non_key_cols'.
You cannot set both.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.