getValues {edl} | R Documentation |
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 |
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 |
Value
A vector with strings
Author(s)
Jacolien van Rij
See Also
strsplit
, sort
, unique
,
getOutcomes
, getCues
Examples
# 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)
[Package edl version 1.1 Index]