Learn R Programming

DTAT (version 0.3-4)

seq.function: 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 `function`
seq(scalefun, from, to, length.out, digits = NULL, ...)

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.

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.

Author

David C. Norris

Examples

Run this code

# 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)

Run the code above in your browser using DataLab