doodle_fun | R Documentation |
Sometimes it's nice to have a simple, smooth but curving function
to illustrate some mathematical point or to support an exercise. doodle_fun()
generates such functions. The function support tends to be in -10 to 10. For the
mathematically adept ... the functions are linear combinations of gaussians
with randomly selected centers, widths, and random coefficients. The mosaic::rfun()
function
is very similar.
doodle_fun(vars = ~x & y, seed = NULL, n = 0)
vars |
A right-sided tilde expression (like |
seed |
An integer setting the seed for random number generation. |
n |
A positive integer. If non-zero, this is a hint about how many local maxes and mins there should be. Just a hint. |
# Two functions of two variables. They are different because the seeds are different.
f <- doodle_fun(~ x & y, seed = 101)
g <- doodle_fun(~ z & u, seed = 121)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.