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

%primes%R Documentation

Find remainder from 'primes' method

Description

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

When using the "primes" method, the last group might not have the size of the associated prime number if there are not enough elements left. Use %primes% to find this remainder.

Usage

size %primes% start_at

Arguments

size

Size to group (Integer)

start_at

Prime to start at (Integer)

Value

Remainder (Integer). Returns 0 if the last group has the size of the associated prime number.

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

See Also

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

Other remainder tools: %staircase%()

Examples

# Attach packages
library(groupdata2)

100 %primes% 2

LudvigOlsen/R-splitters documentation built on Dec. 21, 2024, 1:19 a.m.