createWM: Create empty weight matrix based on a set of cues and...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/createWM.R

Description

Create empty weight matrix based on a set of cues and outcomes.

Usage

1
createWM(cues, outcomes, background = NULL, init.value = 0)

Arguments

cues

A vector with cues.

outcomes

A vector with outcomes.

background

A string specifying the background cue. Sets this as the value of the background cue for all functions in this R session. If NULL, the current value of the background cue will be used.

init.value

Initial value for all connections, typically set to 0.

Value

A weightmatrix (matrix)

Author(s)

Jacolien van Rij

See Also

link{RWlearning}

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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)

edl documentation built on Sept. 20, 2021, 9:09 a.m.

Related to createWM in edl...