detectNonContig: Function to find non-contiguity in response patterns

Description Usage Arguments Details Value Examples

View source: R/extractMoments.r

Description

Function to find non-contiguity in response patterns

Usage

1

Arguments

row

A vector of binned counts

bins

The number of bins: should be the same as the length of row

Details

Assumes there are at least some coins in some bins.

Value

returns either a 0 if there are non-contiguous counts of 1 if there are. Will often be used with apply to operate on a matrix

Examples

1
2
3
4
5
counts2 <- c(1, 2, 1, 4, 4, 2, 0, 0, 0, 0)
counts3 <- c(1, 2, 0, 4, 4, 2, 0, 0, 0, 0)
detectNonContig(counts2)
detectNonContig(counts3)
apply(rbind(counts2, counts3), 1, detectNonContig)

aserlich/gameify documentation built on Sept. 27, 2019, 5:41 p.m.