histC {RCPA3}R Documentation

Creates histogram to show distribution of interval (numeric) variable's values

Description

Generates frequency distribution table of binned values and a histogram to describe distribution of variable values.

Usage

histC(x, w, data, breaks, digits = 2, printC = FALSE, plot = TRUE, main,
  xlab, ylab, bar.col, ...)

Arguments

x

The variable to be analyzed. If dataset not specified with data argument, should be a vector in form dataset$var.

w

(Optional) Sample weights (must be numeric if used), If dataset not specified with data argument, should be in form dataset$weighvar

data

(Optional) Name of dataset that contains x (and w) variable.

breaks

(Optional) Specify how to break the x variable into bins. Options include the number of breaks, a vector specifying the breakpoints, or the name of an algorithm that generates breakpoints. Default value is "Sturges" (other algorithms are "Scott" and "FD", see details in wtd.hist documentation).

digits

(Optional) Number of digits to display after decimal points (default is 2).

printC

(Optional) Do you want the histogram and binned frequencies table printed to working directory? (default: FALSE)

plot

(Optional) Do you want the histogram graphic? (default: TRUE)

main

(Optional) Customize main title for histogram.

xlab

(Optional) Custom label for x-axis of histogram.

ylab

(Optional) Custom label for y-axis of histogram.

bar.col

(Optional) Color for histogram bars; default is "gray80".

...

(Optional) Additional arguments passed to weights::wtd.hist function.

Value

A frequency distribution table of binned x variable values.

RCPA3 Package Tutorial Videos

Textbook References

Online Resources

Examples

   library(RCPA3)
   
   histC(x=states$covid.cases.per1000)
   

[Package RCPA3 version 1.2.1 Index]