adapt_seq | R Documentation |
adapt_seq
is similar to seq
except that instead of
selecting points equally spaced along an interval, it selects points
such that the values of a function applied at those points are
(very) roughly equally spaced. This can be useful for sampling
a function in such a way that it can be plotted more smoothly,
for example.
adapt_seq(
from,
to,
length.out = 200,
f = function(x, ...) {
1
},
args = list(),
quiet = FALSE
)
from |
start of interval |
to |
end of interval |
length.out |
desired length of sequence |
f |
a function |
args |
arguments passed to |
quiet |
suppress warnings about NaNs, etc. |
a numerical vector
adapt_seq(0, pi, 25, sin)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.