dot-fill_grps_from_variables: Back Fill Group Variables

.fill_grps_from_variablesR Documentation

Back Fill Group Variables

Description

This function back fills the values of group variables using variable/variable_levels. The back filling will occur if the value of the variable column matches the name of a grouping variable, and the grouping variable's value is NA.

Usage

.fill_grps_from_variables(x)

Arguments

x

(data.frame)
a data frame

Value

data frame

Examples

data <- data.frame(
  variable = c(rep("A", 3), rep("B", 2)),
  variable_level = 1:5,
  A = rep(NA, 5),
  B = rep(NA, 5)
)

cards:::.fill_grps_from_variables(data)

cards documentation built on Oct. 4, 2024, 1:09 a.m.