repaint: Fills missing data by lookup

View source: R/wrangling_data.R

repaintR Documentation

Fills missing data by lookup

Description

Fills missing data where known by other observations with the same id/index

Usage

repaint(df, id, var)

Arguments

df

a dataframe

id

a string identifying a column in the dataframe for indexing

var

a string identifying a column or columns in the dataframe to be filled

Value

A dataframe

Examples


data <- data.frame(ID = c(1,2,3,3,2,1),
                    One = c(1,NA,3,NA,2,NA),
                    Two = c(NA,"B",NA,"C",NA,"A"))
repaint(data, "ID", c("One","Two"))


manydata documentation built on May 29, 2024, 8:16 a.m.