classify_topics: classify_topics

Description Usage Arguments Value See Also

View source: R/topics.R

Description

Function which takes in a dataframe and column and produces another column, denoting which topic each response is most relevant to

Usage

1
2
classify_topics(dataframe, column, output = "", topic_aliases = "",
  num_topics = 2, confidence = FALSE)

Arguments

dataframe

dataframe or tibble of survey responses

column

string variable of free text responses to which the determine_topics() function has already been applied in this session

output

name of the new column to be produced, defaults to 'column_topic'

topic_aliases

named string vector, denoting for each topic (1,2.. etc.) what it is to be renamed. Leave blank to stay as 'topic1', 'topic2' etc.

num_topics

integer denoting the number of distinct topics to assume are present. Defaults to 2

confidence

logical indicating whether to include topic confidence in output (how likely that the classified topic is definitive)

Value

the original dataframe with an additional column (name specified by output) containing which topic each response in 'column' falls in to, optionally aliased

See Also

Other topics: summarise_topics


chrisbrownlie/surveyr documentation built on Dec. 1, 2019, 12:34 a.m.