shim_colon: Strict version of ':'

Description Usage Arguments Examples

View source: R/shim-colon.R

Description

This version of ':' throws an error if 'from' is positive and 'to' is zero, to make the error more obvious if you've used '1:length(x)' instead of [seq_along()]

Usage

1
shim_colon(from, to)

Arguments

from, to

Passed on to [seq()]

Examples

1
2
3
x <- numeric()
seq_along(x)
lax(1:length(x))

hadley/strict documentation built on May 27, 2019, 7:26 a.m.