plot_setup | R Documentation |
Sets up a plot based on variables in a dataset. The intended use is for chained/piped commands. Returns the same dataset that was passed in.
plot_setup(
d,
f,
xlim = NULL,
ylim = NULL,
log = "",
asp = NA,
xaxs = "r",
yaxs = "r",
...
)
d |
A data.frame. |
f |
Optional. A formula y ~ x. The limits of the plot region is calculated from the range of y and x. |
xlim |
Optional. A 2 element vector, the limits of the x axis. |
ylim |
Optional. A 2 element vector, the limits of the y axis. |
log , asp , xaxs , yaxs |
Optional. Options sent in the plot.window command |
... |
Optional. Options sent to the par command |
iris %>%
plot_setup(Sepal.Length~Sepal.Width) %>%
split(.$Species) %>%
lwith({
l1 <- lm(Sepal.Length~Sepal.Width)
lines(Sepal.Width, predict(l1))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.