all-of-us / workbench-snippets

Code snippets for use in All of Us Workbench notebooks.
BSD 3-Clause "New" or "Revised" License
14 stars 6 forks source link

Create treat_missing_values.R #7

Closed kouamea closed 4 years ago

kouamea commented 5 years ago

Aymone_snippets

deflaux commented 5 years ago

To elaborate further, people might want to handle NAs in different columns differently. For the example dataframe below:

hba1c = data.frame(
  person_id = c(1, 2, 3, 4),
  value_as_number = c(5.5, 6.0, NA, NA),
  value_as_concept_id = c(NA, NA, 42, NA))
deflaux commented 4 years ago

closing old pull requests