Skip to contents

Check if an argument is a valid weights column.

Usage

check_weight(x)

Arguments

x

Function argument that is being checked.

Value

If the argument is a valid weights column, it returns invisible TRUE. Otherwise, the function throws an error.

Examples

if (FALSE) { # \dontrun{
check_weight(c(0.5, 1.5, 3.0))
check_weight(c(0, 1, 2, 3))
check_weight(c(1, NA, 3))
check_weight(c(1, -1, 2))
check_weight("text")
} # }