View source: R/helper.functions.r
wtd.hist | R Documentation |
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.
wtd.hist(x, w = NULL, data, breaks, ...)
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. |
Generate a histogram plot.
library(RCPA3)
wtd.hist(x=nes$age, w=nes$wt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.