Learn R Programming

ThurMod (version 1.1.11)

blocksort: Sorts the blocks in ascending numbering

Description

This function sorts all items in a block into ascending order.

Usage

blocksort(blocks)

Value

Returns a matrix consisting of the blocks where all items per blocks are sorted in ascending order.

Arguments

blocks

A matrix defining the blocks of the model. The number of rows must be the number of blocks, each row represents a block and contains the item numbers. The number of columns represent the number of items per block.

Examples

Run this code

# Define 30 items divided by ten triplets as blocks
blocks <- matrix(c(1:30), ncol = 3)

# sort the blocks
blocksort(blocks)

Run the code above in your browser using DataLab