wtd.hist {RCPA3} | R Documentation |
Creates a Histogram Showing Distribution of Variable Values With Option for Weights Makes use of the wtd.hist function, part of the weights package.
Description
Takes in variable and generates histogram plot to show the distribution of its values, works with sampling weights.
The wtd.hist function is imported from the weights package. See wtd.stats
documentation for details.
Usage
wtd.hist(x, w = NULL, data, breaks, ...)
Arguments
x |
A variable (must be numeric), should be in dataset$var form unless dataset specified in optional data argument. |
w |
Sampling weights of variable (optional), must be numeric; should be in dataset$weightvar form unless dataset specified in optional data argument. |
data |
(Optional) Name of dataset that contains x (and w) variable. |
breaks |
(Optional) Specifies the breakpoints between bins of the histogram. See |
... |
(Optional) Additional arguments passed to weights::wtd.hist function. |
Value
Generate a histogram plot.
Examples
library(RCPA3)
wtd.hist(x=nes$age, w=nes$wt)
[Package RCPA3 version 1.3.1 Index]