ranges: Defines vector as range

View source: R/ranges.R

rangesR Documentation

Defines vector as range

Description

Redefines the class of a vector as "range"

Usage

ranges(x, y)

Arguments

x

first element

y

second element

Value

c(x, y), but with the "range" class

Note

This function was created to be used as an element in the N argument of cluster_gen. The name was chosen to avoid conflict with base::range().

ranges() should always be used within a list(). Inserting a "range" vector inside a common vector (c()) will result in a common vector. For example, c(3, ranges(8, 10)) is the same as c(3, 8, 10), because when faced with conflicting classes in the same element, R will resolve to the simpler case ("numeric", in this case). An easier way to understand this concept is by checking class(c(3, "a")) is "character", meaning the number 3 was devolved into a character "3".


lsasim documentation built on April 3, 2025, 5:57 p.m.