Learn R Programming

sherlock (version 0.7.0)

draw_categorical_scatterplot: Draw Categorical Scatter Plot

Description

Draws a Categorical Scatter Plot

Usage

draw_categorical_scatterplot(
  data,
  y_var,
  grouping_var_1,
  grouping_var_2,
  grouping_var_3,
  grouping_var_4,
  plot_means = FALSE,
  connect_means = FALSE,
  group_color = FALSE,
  point_size = 2,
  alpha = 0.5,
  jitter = FALSE,
  x_axis_text_size = 11,
  panel_text_size = 11
)

Value

A 'ggplot' object

Arguments

data

Input dataset to be plotted (required)

y_var

Y variable to be plotted on Y axis (required)

grouping_var_1

Select column for lowest level grouping variable (optional)

grouping_var_2

Select column for second level grouping variable (optional)

grouping_var_3

Select column for third level grouping variable (optional)

grouping_var_4

Select column for fourth level grouping variable (optional)

plot_means

Logical. if TRUE, means for lowest-level grouping variable are plotted. By default, it is set to FALSE. (optional)

connect_means

Logical. if TRUE, means for lowest-level grouping variable are connected with a line. By default, it is set to FALSE. (optional)

group_color

Set whether to color by grouping_var_1. By default, it is set to FALSE (optional)

point_size

Set point size. By default, it is set to 2 (optional)

alpha

Set transparency. By default, it is set to 0.5 (optional)

jitter

Set whether to add jitter. By default, it is set to FALSE (optional)

x_axis_text_size

Set X axis text size. By default, it is set to 11 (optional)

panel_text_size

Set panel text size. By default, it is set to 11 (optional)

Examples

Run this code
multi_vari_data_2 %>%
   draw_categorical_scatterplot(y_var = Length,
                                grouping_var_1 = Part,
                                grouping_var_2 = Operator,
                                jitter = FALSE)

Run the code above in your browser using DataLab