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_factor(), group()

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)
 }}


groupdata2 documentation built on July 9, 2023, 6:46 p.m.