# 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 <- activationsCueSet(wm, cueset="BG_bicycle_red")
names(activations)
head(activations[[1]])
# plot:
a1 <- activations[[1]]
emptyPlot(nrow(a1), range(a1),
xlab="Learning events", ylab="Activations",
xmark=TRUE, ymark=TRUE, las=1)
for(i in 1:ncol(a1)){
lines(a1[,i], col=i, lty=i)
}
legend_margin('topleft', legend=colnames(a1),
col=1:ncol(a1), lty=1:ncol(a1),
bty='n', cex=.75)
# }
Run the code above in your browser using DataLab