simple_impute: Simple imputations

View source: R/simple_impute.R

simple_imputeR Documentation

Simple imputations

Description

Wrapper for sample

Usage

simple_impute(n, vals, weight_var)

Arguments

n

The number of missing values to impute.

vals

The values to sample from (with replacement).

weight_var

Variable from which to compute relative frequencies of vals to use as prob argument to sample. If missing then the values in vals are sampled with equal probability.

Value

A vector of length n.


jgabry/RHhelpers documentation built on Feb. 22, 2024, 12:56 p.m.