topics_rename: Rename a list of topics to a new list and set the variable as...

View source: R/topics_rename.R

topics_renameR Documentation

Rename a list of topics to a new list and set the variable as a factor with new names as levels

Description

Rename a list of topics to a new list and set the variable as a factor with new names as levels

Usage

topics_rename(df, topic_var, old_names, new_names)

Arguments

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

Value

Data Frame or Tibble with topic variable changed in place

Examples

## 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)

jpcompartir/JPackage documentation built on March 20, 2023, 4 a.m.