grapes-staircase-grapes: Find remainder from 'staircase' method

%staircase%R Documentation

Find remainder from 'staircase' method

Description

\Sexpr[results=rd, stage=render]{lifecycle::badge("stable")}

When using the "staircase" method, the last group might not have the size of the second last group + step size. Use %staircase% to find this remainder.

Usage

size %staircase% step_size

Arguments

size

Size to staircase (Integer)

step_size

Step size (Integer)

Value

Remainder (Integer). Returns 0 if the last group has the size of the second last group + step size.

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

See Also

Other staircase tools: %primes%(), group(), group_factor()

Other remainder tools: %primes%()

Examples

# Attach packages
library(groupdata2)

100 %staircase% 2

# Finding remainder with value 0
size = 150
for (step_size in c(1:30)){
 if(size %staircase% step_size == 0){
   print(step_size)
 }}


LudvigOlsen/R-splitters documentation built on March 7, 2024, 6:59 p.m.