Learn R Programming

AdapDiscom (version 1.0.0)

get_block_indices: Get Block Indices

Description

Get Block Indices

Usage

get_block_indices(pp)

Value

List with start and end indices for each block

Arguments

pp

Vector, block sizes

Examples

Run this code
# Define block sizes
pp <- c(10, 15, 20)
indices <- get_block_indices(pp)
print(indices)
# Shows: $starts = c(1, 11, 26) and $ends = c(10, 25, 45)

# For two blocks
pp2 <- c(25, 25)
indices2 <- get_block_indices(pp2)
print(indices2)

Run the code above in your browser using DataLab