scatterplot_with_fill_and_shape: Plot 2 columns against each other with Fill and Shapes

View source: R/scatterplot_with_fill_and_shape.R

scatterplot_with_fill_and_shapeR Documentation

Plot 2 columns against each other with Fill and Shapes

Description

scatterplot_with_fill_and_shape Takes a data.frame and creates an x-y scatterplot

Usage

scatterplot_with_fill_and_shape(
  plot_data,
  x_var,
  y_var,
  fill_var,
  fill_palette,
  shape_var = "None",
  shape_palette,
  point_labels = NULL,
  label_seed = NA,
  point_size = 4,
  ...
)

Arguments

plot_data

data.frame - plot data

x_var

character - name of the column to plot on the x axis

y_var

character - name of the column to plot on the y axis

fill_var

character - name of the column to use as the fill aesthetic

fill_palette

character - a named character vectors of colours for the fill aesthetic

shape_var

character - name of the column to use as the shape aesthetic

shape_palette

character - a named character vectors of shapes for the shape aesthetic

point_labels

character - labels for the points. Either a column name from the plot_data or a character vector. Default: NULL - no labels

point_size

numeric - size of points

labels_seed

integer - seed for geom_text_repel

Details

The plot data data.frame should contain the columns for the x, y and fill variables and optionally ones for the shape variable and text labels. The text label column should be named sample_name.

Value

ggplot2 object

Examples

scatterplot_with_fill_and_shape( plot_data, 'PC1', 'PC2', 'Gene', fill_palette,
                             'Genotype', shape_palette, sample_names )


richysix/biovisr documentation built on Feb. 3, 2024, 4:36 a.m.