fill.gaps {tempR} | R Documentation |
Fills gaps
Description
Replace gaps in TDS and TCATA data with replacement responses.
Usage
fill.gaps(y, subst = 0, repl = 1)
Arguments
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 |
Value
out vector (or data frame) of Bernoulli data with filled gaps
Examples
# 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)
[Package tempR version 0.10.1.1 Index]