hist_2D: Plot 2d histogram given data. Either rownames or colnames...

View source: R/plotting_functions.R

hist_2DR Documentation

Plot 2d histogram given data. Either rownames or colnames will be x values, and the data will be y values.

Description

Plot 2d histogram given data. Either rownames or colnames will be x values, and the data will be y values.

Usage

hist_2D(
  data,
  data_style = "row",
  xlab = "Digits",
  ylab = "Frequency",
  title = "2D Barplot",
  hline = NA,
  hline_name = "",
  abline = NA,
  width = 0.5
)

Arguments

data

The 1D dataframe to be plotted.

data_style

The style of input data. ggplot requires columns to be the arrays for x values, y values, etc.

  • If data has a row for y values, pass in 'row'.

  • If data has a column for y values, pass in 'col'.

  • Defaulted to 'row'.

xlab

x-axis label. Defaulted to 'digits'.

ylab

y-axis label. Defaulted to 'frequency'.

title

Plot title. Defaulted to '2D Histogram'.

hline

Specifies the y-intercept value if a horizontal line is desired. Defaulted to NA.

hline_name

The title of the horizontal line added. Defaulted to ”.

abline

A ggplot2::geomline() instance that specifies the line to be addded onto the 2D barplot.

width

The width of the bars. Defaulted to 0.5.

Value

A ggplot instance.


jlederluis/digitanalysis documentation built on Nov. 5, 2023, 11:46 a.m.