seq.function | R Documentation |
This provides a seq
method for class function
, supporting a
natural axis scaling idiom.
## S3 method for class ''function''
seq(scalefun, from, to, length.out, digits = NULL, ...)
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. |
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
.
David C. Norris
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.