Learn R Programming

ProbBayes (version 1.1)

bar_plot: Bar plot of numeric or character data

Description

Constructs frequency bar plot of a vector of numeric data or a vector of character data

Usage

bar_plot(y, ...)

Arguments

y

vector of outcomes

...

title of the graph

Value

A ggplot2 object containing the bar graph.

Examples

Run this code
# NOT RUN {
  s <- spinner_data(c(1, 2, 2, 1), nsim=100)
  bar_plot(s, "Spinner Data")
  y <- c(rep("a", 10), rep("b", 5),
         rep("c", 8), rep("d", 4))
  bar_plot(y)
# }

Run the code above in your browser using DataLab