make_random_block {autoFC}R Documentation

Construction of Random Item Blocks

Description

Returns a matrix of randomly paired blocks where each row represents a block.

Usage

make_random_block(total_items, target_items = total_items, item_per_block)

Arguments

total_items

Integer value. Determines the total number of items we sample from.

target_items

Integer value. Determines the number of items to use from total_items to build item blocks. Default to be equal to total_items. Should be no more than total_items.

item_per_block

Integer value. Determines the number of items in each item block. Should be no less than 2.

Details

Given the total number of items to pair from, number of items to build paired blocks and number of items in each block, make_random_block produces a matrix randomly paired blocks where each row represents a block.

It can also accommodate cases when target_items is not a multiple of item_per_block.

Can be used as initial solution for other functions in this package.

Value

A matrix of integers indicating the item numbers, where the number of rows equals target_items divided by item_per_block, rounded up, and number of columns equals item_per_block.

Note

If target_items is not a multiple of item_per_block, the item set produced by target_items will be looped until number of sampled items becomes a multiple of item_per_block.

Author(s)

Mengtong Li

Examples

# Try out cases where you make target_items the default.
make_random_block(60, item_per_block = 3)

# You can also set your own values of target_items.
make_random_block(60, 45, item_per_block = 3)

# Also see what happens if target_items is not a multiple of item_per_block.
make_random_block(60, 50, item_per_block = 3)


[Package autoFC version 0.1.2 Index]