seq_range: Sequence generation based on range of input.

Description Usage Arguments Details Value Examples

View source: R/seq_range.R

Description

Generates regular sequences from the minimum to the maximum of the input.

Usage

1
seq_range(x, length.out, extend = 0, procent = FALSE)

Arguments

x

Vector whoes range is used to generate the sequence.

length.out

desired length of the sequence. A non-negative number.

extend

Numeric, number of which to extend the range by.

procent

Indicates if extend is taken as a procentage.

Details

The extend parameter can be either of length 1 or 2. If the length is 1 then the number is subtracted from the minimum, and added to the maximum. Thus extending the range by extend * 2. If the length is 2 then the first number is subtracted from the minimum and the second number is added to the maximum.

If procent is set to TRUE then extend is taken as a procentage where 1 is equal to the range, i.e. the distance from the minimum to the maximum.

Value

returns a vector of type "integer" or "double".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 seq_range(1:5, 10)

 seq_range(1:5, 10, 1)

 seq_range(1:5, 10, 1:2)

 seq_range(rnorm(100), 10)

 seq_range(rnorm(100), 10, 0.1, TRUE)

 seq_range(1:5, 10, extend = 1, procent = TRUE)

EmilHvitfeldt/ehlib documentation built on Aug. 15, 2021, 12:34 a.m.