Learn R Programming

SIN (version 0.6)

is.blocks: Check variable blocking

Description

This function checks whether a list of vectors defines a valid decomposition of the set of variables into blocks.

Usage

is.blocks(blocks, p)

Arguments

blocks
a list of integer vectors representing a family of subsets of the variable set.
p
the number of variables.

Value

The function returns TRUE if the block structure is such that each variable is represented in exactly one of the blocks. Otherwise, FALSE is returned.

Examples

Run this code
p <- 6
blocks <- list(1:3,6,5:4)
is.blocks(blocks, p)
blocks <- list(1:3,7,5:4)
is.blocks(blocks, p)
blocks <- list(1:2,6,5:4)
is.blocks(blocks, p)

Run the code above in your browser using DataLab