Skip to contents

Convert a data_prep_function, into a function that can be used in an iidda data prep pipeline.

Usage

CustomDataPrep(
  data_prep_function,
  ign_variables = character(0L),
  opt_variables = character(0L),
  new_variables = character(0L)
)

Arguments

data_prep_function

A standard R function that takes a data frame, called data as its first argument, and returns another data frame. Optionally, subsequent arguments can be added that give the names of types of variables (e.g., period_end_variable = "period_end_date"). Consider using NULL as the default of these variable name arguments, which will lead to good guesses about variable names when data are obtained from iidda.api.

Value

description A data prep function that maintains iidda attributes and guesses at names of types of variables that the data_prep_function assumes.