seq.function: A seq method supporting custom-scaled plot axes.

View source: R/seq.function.R

seq.functionR Documentation

A seq method supporting custom-scaled plot axes.

Description

This provides a seq method for class function, supporting a natural axis scaling idiom.

Usage

## S3 method for class ''function''
seq(scalefun, from, to, length.out, digits = NULL, ...)

Arguments

scalefun

A numeric function that will be invoked componentwise, and so need not be vectorized)

from, to

The starting and ending values of the sequence returned

length.out

Desired length of the sequence

digits

If non-NULL, returned value is rounded accordingly

...

Unused; included for S3 generic/method consistency.

Value

A numeric vector that (not considering the effect of any rounding applied), becomes an arithmetic sequence after application of scalefun to it. The initial and final elements of that vector are from and to.

Author(s)

David C. Norris

Examples


# Provide evenly-spaced length-6 sequence from 100 to 1000,
# evenly spaced on a fourth-root scale:
seq(function(dose, a=4.0) dose^(1/a), from=100, to=1000, length.out=6, digits=0)


DTAT documentation built on May 29, 2024, 7:10 a.m.