custbarplot: Make a bar plot of responses on Likert scale

Description Usage Arguments Value Examples

Description

Make a bar plot of responses on Likert scale

Usage

1
2
custbarplot(data, xvar, grpvar, withingrp = FALSE, scalepoints = 7,
  decimals = TRUE, scale = "Agree", ...)

Arguments

data

Name of dataset (must be in wide format, i.e., one row per participant)

xvar

Name of variable of interest measured on Likert scale

grpvar

Name of variable of type factor by which bars should be split

withingrp

Logical value indicating whether or not percentages should be calculated within groups

scalepoints

Numeric value indicating number of scalepoints in Likert scale (at present, can take on value of 5 or 7)

decimals

Logical value indicating whether or not xvar is on a non-integer scale

scale

Character value indicating scale labels (at present, can take on values of "Agree", "Quant", or "True")

...

Other arguments to pass on to ggplot

Value

A barplot showing the counts and percentages of all values of xvar

Examples

1
2
mtcars$am <- as.factor(mtcars$am)
custbarplot(mtcars, xvar = gear, grpvar = am, withingrp = TRUE, scalepoints = 5, decimals = FALSE)

mnetter589/R4BehavSciPackage documentation built on May 24, 2019, 4:09 p.m.