splitto: Split to equal length groups

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Return start & end index of each group

Usage

1
splitto(totlen, grplen)

Arguments

totlen

Integer specifying total length

grplen

Integer specifying length of each group

Details

Note: splitto() is similar to split() but splitto() does works fine (no warnings) when grplen is not a multiple of totlen

Value

list of vectors

Examples

1
2
3
splitto(10, 3)    # list("1"=1:3, "2"=4:6, "3"=7:9, "4"=10)
splitto(100, 24)  # list("1"=1:24, "2"=25:48, "3"=49:72, "4"=73:96, "5"=97:100)
splitto(10, 20)   # list("1"=1:10)

Oxylo/canaries documentation built on Oct. 30, 2019, 10:23 p.m.