View source: R/has_all_items.R
has_all_items | R Documentation |
check that a data frame has all of the specified items in the specified column. if it does not have those items, add them. Also has functionality to alter the added rows.
has_all_items(df, column, col_items, cols_to_modify = NULL)
df |
data frame to check |
column |
column that should have all of the items specified in col_items |
col_items |
items that should be present in col_items |
cols_to_modify |
named list of columns that should be modified, where list names correspond to column names and values correspond to new values that should be in the added rows |
a df
df <- data.frame(groups = letters[1:5], value = rnorm(5)) has_all_items(df, groups, letters[1:10], list(value = 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.