textcleaner | R Documentation |
An automated cleaning function for spell-checking, de-pluralizing, removing duplicates, and binarizing text data
textcleaner( data = NULL, type = c("fluency", "free"), miss = 99, partBY = c("row", "col"), dictionary = NULL, spelling = c("UK", "US"), add.path = NULL, keepStrings = FALSE, allowPunctuations, allowNumbers = FALSE, lowercase = TRUE, keepLength = NULL, keepCue = FALSE, continue = NULL )
data |
Matrix or data frame. For
For
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type |
Character vector. Type of task to be preprocessed.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
miss |
Numeric or character.
Value for missing data.
Defaults to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
partBY |
Character.
Are participants by row or column?
Set to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dictionary |
Character vector.
Can be a vector of a corpus or any text for comparison.
Dictionary to be used for more efficient text cleaning.
Defaults to Use | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
spelling |
Character vector. English spelling to be used.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
add.path |
Character.
Path to additional dictionaries to be found.
DOES NOT search recursively (through all folders in path)
to avoid time intensive search.
Set to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keepStrings |
Boolean.
Should strings be retained or separated?
Defaults to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
allowPunctuations |
Character vector.
Allows punctuation characters to be included in responses.
Defaults to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
allowNumbers |
Boolean.
Defaults to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lowercase |
Boolean.
Should words be converted to lowercase?
Defaults to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keepLength |
Numeric.
Maximum number of words allowed in a response.
Defaults to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keepCue |
Boolean.
Should cue words be retained in the responses?
Defaults to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
continue |
List.
A result previously unfinished that still needs to be completed.
Allows you to continue to manually spell-check their data
after you've closed or errored out.
Defaults to |
This function returns a list containing the following objects:
binary |
A matrix of responses where each row represents a participant
and each column represents a unique response. A response that a participant has provided is a ' |
responses |
A list containing two objects:
|
spellcheck |
A list containing three objects:
|
removed |
A list containing two objects:
|
partChanges |
A list where each participant is a list index with each
response that was been changed. Participants are identified by their ID (see argument |
Alexander Christensen <alexpaulchristensen@gmail.com>
Christensen, A. P., & Kenett, Y. N. (in press). Semantic network analysis (SemNA): A tutorial on preprocessing, estimating, and analyzing semantic networks. Psychological Methods.
Hornik, K., & Murdoch, D. (2010). Watch Your Spelling!. The R Journal, 3, 22-28.
# Toy example raw <- open.animals[c(1:10),-c(1:3)] if(interactive()) { #Full test clean <- textcleaner(open.animals[,-c(1,2)], partBY = "row", dictionary = "animals") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.