# 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)
# the function RWlearning uses createWM to construct a weight matrix:
cues <- getValues(dat$Cues, unique=TRUE)
outcomes <- getValues(dat$Outcomes, unique=TRUE)
createWM(cues=cues, outcomes=outcomes)
# add background cue:
createWM(cues=cues, outcomes=outcomes, background=TRUE)
# }
Run the code above in your browser using DataLab