This is a simple Shiny app to plot a histogram. Meant as a gentle introduction to Shiny inputs and outputs.

shiny_hist(
  data,
  x,
  title = "Histogram",
  xlab = "x",
  ylab = "y",
  main = "Histogram",
  col = "blue",
  bins = 10,
  xlim = range(bins),
  ylim = NULL,
  border = "black",
  lwd = 1,
  lty = 1,
  cex = 1,
  cex.main = 1,
  cex.lab = 1,
  cex.axis = 1,
  cex.sub = 1
)

Arguments

data

Data frame

x

Name of column in data plot. Must be a numeric vector.

title

Title of the plot.

xlab

X-axis label.

ylab

Y-axis label.

main

Main title.

col

Color of the bars.

bins

Number of bins.

xlim

Limits of the x-axis.

ylim

Limits of the y-axis.

border

Color of the border.

lwd

Line width of the border.

lty

Line type of the border.

cex

Axis label size.

cex.main

Main title size.

cex.lab

Axis label size.

cex.axis

Axis tick label size.

cex.sub

Subtitle size.

Value

A Shiny app to plot a histogram.

See also

Author

Jared Andrews

Examples

if (FALSE) {
data <- data.frame(x = rnorm(100))
shiny_hist(data, x = "x")
}