Learn R Programming

SemNetCleaner (version 1.0.0)

corr.chn: Correct Changes from textcleaner

Description

Allows corrections to changes made by textcleaner. Some changes may have been made by accident, some changes may have been made by the automated cleaning, while others may just need to be removed. This function will correct any changes made in a cleaned textcleaner object.

Usage

corr.chn(textcleaner.obj, old)

Arguments

textcleaner.obj

A textcleaner object

old

Character vector. A vector of old response(s) to change. See the object spellcheck$unique in textcleaner output

Value

This function returns a list containing the following textcleaner objects, which have been corrected with the user-provided changes:

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 '1' and a response that a participant has not provided is a '0'

resposnes

A response matrix that has been spell-checked and de-pluralized with duplicates removed. This can be used as a final dataset for analyses (e.g., fluency of responses)

spellcheck

A list containing two objects: full and unique. full contains all responses regardless of spellcheck changes and unique contains only responses that were changed during the spell-check

removed

A list containing two objects: rows and ids. rows identifies removed participants by their row (or column) location in the original data file and ids identifies removed participants by their ID (see argument data in textcleaner)

partChanges

A list where each participant is an object with their responses that have been changed. Participants are identified by their ID (see argument data in textcleaner). This can be used to replicate the cleaning process and to keep track of changes more generaly. Participants with NA did not have any changes from the original data and participants with NULL were removed due to missing data (see removed$ids)

Details

This function is used to correct mistakes that occur in the cleaning process during textcleaner. There are times when you are too deep into the text cleaning process that accidentally hitting a '1' instead of a '2' does not make sense to stop and start the text cleaning process over. Rather when mistakes are made, a record can be kept and this function will allow those mistakes to be amended.

Old responses should be used as input. A menu will prompt the user for their decision on how to manage the incorrectly cleaned response. There are three potential options:

  • 1: TYPE MY OWN Allows user to type their own response. If multiple responses, then commas should separate each response. Quotations are not necessary.

  • 2: GOOGLE IT "Googles" the response in question. A browser will open with the Google search terms: define "RESPONSE"

  • 3: BAD RESPONSE When selected, NA will be returned

Examples

Run this code
# NOT RUN {
#load data
dat <- trial

# }
# NOT RUN {
tc.obj <- textcleaner(dat, partBY = "col")

rmat <- corr.chn (tc.obj, "rat")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab