fill_col_with_agg_by_group {vvfiller}R Documentation

Fill column with aggregate by group

Description

Calculate a summary statistic (mean, median, vvconverter::mode, min, max etc.) by group and use it to fill missing values in a column. Primarily for use in fill_with_agg_by_group().

Usage

fill_col_with_agg_by_group(df, group, col, statistic)

Arguments

df

tibble to use

group

string or vector of strings: columns to group by

col

string: column to impute

statistic

function: summary statistic to use (mean, median, min etc.). For now requires a function with na.rm argument

Value

a filled vector


[Package vvfiller version 0.6.7 Index]