wtd.hist: Creates a Histogram Showing Distribution of Variable Values...

View source: R/helper.functions.r

wtd.histR 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 wtd.hist documentation for details.

...

(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)

RCPA3 documentation built on May 29, 2024, 12:19 p.m.

Related to wtd.hist in RCPA3...