Learn R Programming

tidysynthesis (version 0.1.2)

enforce_custom_na: Redefine NA value for a dataset.

Description

Redefine NA value for a dataset.

Usage

enforce_custom_na(data, col_schema)

Value

A data.frame

Arguments

data

A data.frame object

col_schema

A col_schema from a schema object

Examples

Run this code

# create custom NA filter
example_na_custom <- example_na |>
  tidyr::replace_na(
    list("wages" = -999)
  )

example_na_expanded_custom <- enforce_custom_na(
  data = example_na_custom,
  col_schema = list(
    "wages" = list(
      dtype = "dbl",
      na_value = -999
     )
   )
 )

Run the code above in your browser using DataLab