wrap.hist: Histogram plots

Description Usage Arguments See Also Examples

View source: R/wrap.hist.R

Description

Creates histogram plot for numerical dependent variables and prints descriptive statistics in a summary table. The function delegates the primary computations to ggplot.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
wrap.hist(
  dv1,
  likert = F,
  percent = T,
  binwidth = 1,
  xlim = NULL,
  xmajor = NULL,
  xlab = NULL,
  ylim = NULL,
  ymajor = NULL,
  ylab = NULL,
  title = NULL,
  size.axis.text.y = 12,
  size.axis.text.x = 12,
  size.title = 24
)

Arguments

dv1

Column vector containing the dependent variable

likert

A logical argument: If FALSE, the function assumes a continuous dependent variable; if TRUE, the function assumes a discrete dependent variable that takes on only integer values

percent

A logical argument: if TRUE, the plot displays percentages along the y axis; if FALSE, the plot displays counts

binwidth

Numeric argument representing bin width

xlim

Numeric vector containing x-axis limits

xmajor

Numeric argument representing spacing of x-axis labels

xlab

String containing the x-axis label

ylim

Numeric vector containing y-axis limits

ymajor

Numeric argument representing spacing of y-axis limits

ylab

String containing the y-axis label

title

String containing plot title

size.axis.text.x, size.axis.text.y, size.title

Numeric arguments containing font sizes

See Also

ggplot

Examples

1
2
3
4
5
## Histogram for a continuous dependent variable
wrap.hist(dv1 = bdata$DV8, likert = FALSE)

## Histogram for a discrete dependent variable
wrap.hist(dv1 = bdata$DV1, likert = TRUE)

michaelkardas/behavioralwrappers documentation built on Jan. 2, 2020, 7:46 a.m.