gcurve {figuRes2} | R Documentation |
gcurve
Description
A function to exploit base R's curve function. This returns a data.frame holding x and y values returned from a call to curve, but suppress the plotting of that function
Usage
gcurve(
expr,
from = NULL,
to = NULL,
n = 101,
add = FALSE,
type = "l",
xname = "x",
xlab = xname,
ylab = NULL,
log = NULL,
xlim = NULL,
category = NULL,
...
)
Arguments
expr |
inherited from curve |
from |
inherited from curve |
to |
the range over which the function will be plotted. |
n |
inherited from curve |
add |
inherited from curve |
type |
inherited from curve |
xname |
inherited from curve |
xlab |
inherited from curve |
ylab |
inherited from curve |
log |
inherited from curve |
xlim |
inherited from curve |
category |
option to add a column populated with a factor (by gcurve) |
... |
inherited from curve |
Value
A data.frame is returned. Columns include x, y, and optionally category.
Author(s)
Greg Cicconetti
See Also
graphics::curve
Examples
{
require(ggplot2)
curve(dnorm(x, mean=0, sd=1), from=-4, to = 4, n= 1001)
ggplot(gcurve(expr = dnorm(x, mean=0, sd=1),from=-4, to = 4, n= 1001,
category= "Standard Normal"), aes(x=x, y=y)) + geom_line()
}
[Package figuRes2 version 1.0.0 Index]