ggPoints: Make an interactive scatterplot with regression line(s)

Description Usage Arguments Examples

View source: R/ggPoints.R

Description

Make an interactive scatterplot with regression line(s)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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

1
2
3
4
5
6
7
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)

Example output

Loading required package: ggplot2
Loading required package: ggiraph
Loading required package: plyr

ggiraphExtra documentation built on Oct. 23, 2020, 7:39 p.m.