Learn R Programming

sjPlot (version 1.7)

weight: Weight a variable

Description

This function weights the variable var by a specific vector of weights.

Usage

weight(var, weights)

Arguments

Value

The weighted var.

See Also

weight2

Examples

Run this code
v <- sample(1:4, 20, TRUE)
table(v)
w <- abs(rnorm(20))
table(weight(v,w))

Run the code above in your browser using DataLab