ggPoints {ggiraphExtra} | R Documentation |
Make an interactive scatterplot with regression line(s)
Description
Make an interactive scatterplot with regression line(s)
Usage
ggPoints(
data,
mapping,
smooth = TRUE,
se = TRUE,
method = "auto",
formula = y ~ x,
fullrange = FALSE,
level = 0.95,
use.count = FALSE,
maxfactorno = 6,
digits = 2,
title = NULL,
subtitle = NULL,
caption = NULL,
use.label = TRUE,
use.labels = TRUE,
tooltip = NULL,
interactive = FALSE,
...
)
Arguments
data |
a data.frame |
mapping |
Set of aesthetic mappings created by aes or aes_. |
smooth |
Logical. Add regression lines to the scatter plot |
se |
Logical. display confidence interval around linear regression? (TRUE by default) |
method |
smoothing method (function) to use, eg. "lm", "glm", "gam", "loess", "rlm" |
formula |
formula to use in smoothing function, eg. y ~ x, y ~ poly(x, 2), y ~ log(x) |
fullrange |
should the fit span the full range of the plot, or just the data |
level |
level of confidence interval to use (0.95 by default) |
use.count |
Logical. If true use geom_count instead of geom_point_interactive |
maxfactorno |
An integer. Maximum unique number of a numeric vector treated as a factor |
digits |
integer indicating the number of decimal places |
title |
The text for plot title |
subtitle |
The text for plot subtitle |
caption |
The text for plot caption |
use.label |
Logical. Whether or not use column label in case of labelled data |
use.labels |
Logical. Whether or not use value labels in case of labelled 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 |
... |
other arguments passed on to geom_point |
Examples
require(ggplot2)
require(ggiraph)
require(plyr)
ggPoints(aes(x=wt,y=mpg,fill=am),data=mtcars)
ggPoints(aes(x=wt,y=mpg),data=mtcars)
ggPoints(aes(x=wt,y=mpg,fill=am),data=mtcars,method="lm",interactive=TRUE)
ggPoints(aes(x=wt,y=mpg,color=am),data=mtcars,interactive=TRUE)