Description Usage Arguments Methods (by class) Examples
Make an interactive scatterplot
1 2 3 4 5 6 7 8 9 |
x |
An R object to ggPoints |
... |
other arguments passed on to geom_point |
yvar |
A character string of column name be used as a y-axis variable. |
xvar |
A character string of column name be used as a x-axis variable |
colorvar |
A character string of column name be used as a colour variable. Default value is NULL |
fillvar |
A character string of column name be used as a fill variable. Default value is NULL |
facetvar |
A character string of column name be used as a facet variable. Default value is NULL |
se |
Logical. display confidence interval around linear regression? (TRUE by default) |
method |
smoothing method (function) to use, eg. "lm", "glm", "gam", "loess", "rlm" |
fullrange |
should the fit span the full range of the plot, or just the data |
tooltip |
A character string of column name be included in tooltip. Default value is NULL |
interactive |
A logical value. If TRUE, an interactive plot will be returned |
data |
a data.frame |
x |
A data.frame |
x |
A formula of type y ~ x | B |
data |
A data.frame |
... |
other arguments passed on to ggScatter.defalut |
default
: Draw scatterplot
formula
: Draw scatterplot
1 2 3 4 5 6 7 8 9 10 11 12 | require(moonBook)
require(ggplot2)
require(ggiraph)
ggScatter(iris,yvar="Sepal.Width",xvar="Sepal.Length",method="lm",interactive=TRUE)
ggScatter(iris,yvar="Sepal.Width",xvar="Sepal.Length",se=FALSE,colorvar="Species",interactive=TRUE)
ggScatter(acs,yvar="weight",xvar="height",colorvar="Dx",facetvar="Dx",se=FALSE,method="lm",interactive=TRUE)
ggScatter(iris,yvar="Sepal.Width",xvar="Sepal.Length",colorvar="Species",interactive=TRUE)
ggScatter(radial,yvar="NTAV",xvar="age",colorvar="DM",facetrvar="DM",interactive=TRUE)
require(moonBook)
ggScatter(weight~height|sex,data=radial,interactive=TRUE)
ggScatter(weight~height|sex,data=radial,fullrange=TRUE,se=FALSE,interactive=TRUE)
ggScatter(weight~height,data=radial,interactive=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.