Learn R Programming

SemNetCleaner (version 1.1.0)

autoDestr: Automated De-string of Responses

Description

Automated de-string responses after performing textcleaner. This function is to streamlines the de-stringing of like responses with other like responses (e.g., "roaches" with "cockroaches") into one singular function.

Usage

autoDestr(rmat, char = 10)

Arguments

rmat

Binary response matrix. A textcleaner filtered response matrix

char

Numeric. Minimum number of characters in a string to be checked for by destr. Defaults to 10

Value

A list containing two objects:

rmat

A response matrix that has been de-stringed

string

A list containing the responses that were de-stringed. The row number is supplied for each case that was affected. This can be used to replicate the de-stringing process and to keep track of changes more generally

Examples

Run this code
# NOT RUN {
# Toy example
raw <- open.animals[c(1:10),-c(1,2)]

# Clean and prepocess data
clean <- textcleaner(raw, partBY = "row", dictionary = "animals")

# Obtain binary data
bin <- clean$binary

# Change column name as an example
colnames(bin)[1] <- "alpaca.ant.antelope"

# Automated de-string
if(interactive())
{convmat <- autoDestr(bin, 10)}

# }

Run the code above in your browser using DataLab