Description Usage Arguments Details Value Examples
View source: R/extractMoments.r
Function to find non-contiguity in response patterns
1 | detectNonContig(row, bins = length(row))
|
row |
A vector of binned counts |
bins |
The number of bins: should be the same as the length of |
Assumes there are at least some coins in some bins.
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.