Learn R Programming

edl (version 1.1)

getValues: Retrieve all cues from a vector of text strings.

Description

Retrieve all cues from a vector of text strings.

Usage

getValues(text, split = "_", unique = FALSE, decreasing = FALSE)

Arguments

text

A vector with text strings containing cues or outcomes, separated by a symbol specified by split.

split

separator between cues.

unique

Logical: only return unique values (TRUE) or all values (FALSE, default). When unique values are bein returned, they are sorted.

decreasing

Logical: sorting in alphabetical order (FALSE, default) or the reverse order (TRUE)? Only applies when unique is set to TRUE.

Value

A vector with strings

See Also

strsplit, sort, unique, getOutcomes, getCues

Examples

Run this code
# NOT RUN {
# load example data:
data(dat)
# prepare training data:
dat$Cues <- paste("BG", dat$Shape, dat$Color, sep="_")
dat$Outcomes <- dat$Category
dat$Frequency <- dat$Frequency1
train <- createTrainingData(dat)

# find all cues in trainingdata:
cues <- getValues(train$Cues)
table(cues)
# find all outcomes in data:
out <- getValues(train$Outcomes)
table(out)
# find (sorted) unique cues and outcomes:
getValues(dat$Cues, unique=TRUE)
getValues(dat$Outcomes, unique=TRUE)

# }

Run the code above in your browser using DataLab