View source: R/topics_rename.R
topics_rename | R Documentation |
Rename a list of topics to a new list and set the variable as a factor with new names as levels
topics_rename(df, topic_var, old_names, new_names)
df |
Data Frame or Tibble object |
topic_var |
The current variable the topics are stored in |
old_names |
The old names of the topics |
new_names |
New names of the topics |
Data Frame or Tibble with topic variable changed in place
## Not run:
Example 1:
old_names <- paste0("topic_", 1:2)
new_names <- c("New Topic 1", "New Topic 2")
df %>% topics_rename(topic_var = name, old_names = old_names, new_names = new_names)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.