scatter_plot: Produce a scatter plot of x/y points. If x is a...

Description Usage Arguments Value Author(s)

View source: R/scatter_plot.R

Description

Function returns a plot object of x/y scatter points where the x variable can possibly be a category/factor type variable.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
scatter_plot(
  df,
  aes_x,
  aes_y,
  title = NULL,
  subtitle = NULL,
  x_label = aes_x,
  y_label = aes_y,
  x_limits = c(0, 10, 1),
  y_limits = c(0, 10, 1),
  pts_color = "black",
  pts_alpha = 1,
  pts_size = 1,
  factor_var = NULL,
  factor_levels = NULL,
  factor_colors = NULL,
  factor_level_panels = FALSE,
  n_rows = 1,
  n_cols = length(factor_levels),
  connect = NULL,
  connect_color = "red"
)

Arguments

df

The target data frame from which the scatter points are plotted.

aes_x

A string that sets the x axis variable name from df.

aes_y

A string that sets the y axis variable name from df.

title

A string that sets the overall title.

subtitle

A string that sets the overall subtitle.

x_label

A string that sets the x axis title.

y_label

A string that sets the y axis title.

x_limits

A numeric vector that sets the minimum, maximum, and interval for the x axis.

y_limits

A numeric vector that sets the minimum, maximum, and interval for the y axis.

pts_color

A string that sets the color of the points.

pts_alpha

A numeric value that sets the alpha level of pts_color.

pts_size

A numeric value that sets the size of the points.

factor_var

A string that sets the factor variable that has multiple levels from df.

factor_levels

A character vector that sets the levels to be plotted from factor_var.

factor_colors

A character vector that sets the colors for each of the values in factor_levels.

factor_level_panels

A logical that if TRUE will draw the levels of factor_var in separate panels. Otherwise all levels of factor_var will plot on a single x axis with different colors.

n_rows

An integer that defines the number of panel rows if factor_level_panels is TRUE.

n_cols

An integer that defines the number of panel columns if factor_level_panels is TRUE.

connect

A string that sets the variable from df that will connect its values as a line across aes_x.

connect_color

A string that sets the color of the connect line.

Value

A plot object.

Author(s)

Rick Dean


deandevl/R_plotter_pkg documentation built on Dec. 19, 2019, 12:03 a.m.