fill.gaps: Fills gaps

View source: R/tcata.R

fill.gapsR 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 0.

repl

value occurring for a response (used to replace gap values). Default is 1.

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)

tempR documentation built on Sept. 8, 2023, 5:19 p.m.

Related to fill.gaps in tempR...