scatter_chart: Create scatter chart

Description Usage Arguments Details Examples

View source: R/scatter-chart.R

Description

This function is a convinient overlay for creating a beautiful scatter plot using ggplot2

Usage

1
2
3
4
5
scatter_chart(data, x, y, na.rm = FALSE, name.label = NULL,
  name.labels.show = NULL, label.just = NULL, title = NULL,
  sub.title = NULL, y.title = NULL, x.title = NULL, x.min = NULL,
  x.max = NULL, y.min = NULL, y.max = NULL, prediction.interval = FALSE,
  ...)

Arguments

data

data frame containing data for plotting

x

character string specifying name of x variable in data frame

y

character

na.rm

a logical indicating whether NA values should be removed

name.label

character string specifying column name of names for textual annotations

name.labels.show

numeric or character string indicating either the number of label names to show or the specific names (details)

label.just

numeric vector with length two setting the horizontal and the vertical text alignment for data point labels

title

character string specifying chart title

sub.title

character string specifying chart sub title

y.title

character string specifying y-axis title

x.title

character string specifying x-axis title

x.min

numeric setting minimum limit on x-axis

x.max

numeric setting maximum limit on x-axis

y.min

numeric setting minimum limit on y-axis

y.max

numeric setting maximum limit on y-axis

prediction.interval

logical indicating whether a prediction interval should be computed and ploted

Details

If the name.labels.show is numeric the data point labels shown are based on the distance between actual and fitted y-values. If the variable is set to 3 then the three points with largest absolute distance between actual y-values and the fitted values will have their name shown. This functionality requires that the prediction.interval is set to TRUE. If the name.labels.show is a character string then names are explicitly shown in the scatter plot.

Examples

1
2
3
data(mtcars)
density_chart(mtcars, "mpg", "cyl", title = "Miles per gallon",
sub.title = "(per groups of cylinders)", vline = TRUE)

pgarnry/ggplotHelper documentation built on May 25, 2019, 2:54 a.m.