# NOT RUN {
# load example data:
data(dat)
# add obligatory columns Cues, Outcomes, and Frequency:
dat$Cues <- paste("BG", dat$Shape, dat$Color, sep="_")
dat$Outcomes <- dat$Category
dat$Frequency <- dat$Frequency1
head(dat)
# now use createTrainingData to sample from the specified frequencies:
train <- createTrainingData(dat)
head(train)
# this training data can actually be used train network:
wm <- RWlearning(train)
# Now we calculate the activations for all outcomes
# per event:
activations <- activationsOutcomes(wm, train)
head(activations)
# Now with selection of outcomes (note that 'dog' does
# not occur as outcome in the data):
activations2 <- activationsOutcomes(wm, train,
select.outcomes = c("plant", "vehicle", "dog"))
head(activations2)
tail(activations2)
# }
Run the code above in your browser using DataLab