generateWordCloudData: Generate Data for Wordcloud Use

Description Usage Arguments Value

View source: R/generate.R

Description

Generates cleaned and combined data for wordcloud use. Has functionality to combine words by word stem into the most common full English word appearing in the input, as well as to spell check the inputted text data.

Usage

1
2
generateWordCloudData(txt, spellcheck = TRUE, combine = TRUE, name = "wordcloud_text",
  location = getwd(), keepWords = NULL, replaceWords = NULL)

Arguments

txt

a character or character vector, the text data you wish to use

spellcheck

logical, whether or not to spellcheck the input. Defaults to TRUE. Custom-entered replacements will be made regardless.

combine

logical, whether or not to stem and combine the input. Defautls to TRUE

name

a character, the name of the folder to output the data to. Defaults to wordcloud_text

location

a character, the file directory in which to place the folder. Defaults to the current working directory.

keepWords

a character vector, the words to replace with a custom replacement

replaceWords

a character vector, the replacements

mergekeep

a character vector of words to force merge into specific groups

mergereplace

a character vector of destinations for the force-merged words

bestkeep

a character vector of identified best sources to force to a new name

bestreplace

a character vector of new names to send the specified sources

Value

No output value is created. Several files are written to the specified location under the specified folder name:

cleanedOEs.txt

A text file containing each cleaned, stemmed, and origin-matched word repeated the same number of times as its sources appear in the input text. This file is intended to be easily copied and pasted into Wordle or any other word cloud generator.

stem_map_with_freqs.csv

A csv file, which can be openned in Microsoft Excel, that contains each outputted matched word, the stem used to match to it, all the source words found in the cleaned input that stemmed to it, and combined frequency of all the sources.

made_spelling_replacements.csv

If spellcheck is TRUE, a csv file is generated indicating every word that is replaced during spellchecking and the correct word it is replaced with.

custom_spelling_replacements.csv

The custom replacements provided.


mattgarber4/gsgWordcloud documentation built on Nov. 4, 2019, 6:17 p.m.