fill.gaps | R Documentation |
Replace gaps in TDS and TCATA data with replacement responses.
fill.gaps(y, subst = 0, repl = 1)
y |
vector (or data frame) of Bernoulli data which may contain gaps |
subst |
value occurring in a gap (which represents real data outside a gap). Default is |
repl |
value occurring for a response (used to replace gap values). Default is |
out vector (or data frame) of Bernoulli data with filled gaps
# vector with gaps: x with NA gaps (e.g. due to attribute cuing)
(x <- rep(c(rep(NA, 4), rep(1, 4)), 2))
fill.gaps(x, subst = NA)
# array with gaps: y with an gap of 0s (e.g. due to attribute fading)
(y <- structure(c(0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0,
1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0),
.Dim = c(3L, 10L),
.Dimnames = list(1:3, 1:10)))
fill.gaps(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.