From 623df091b3b570cf545466082a4f313d2b35a0f3 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Wed, 9 Aug 2023 15:47:17 -0400 Subject: [PATCH] Add preallocation for mindiff --- R/infants_clean.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/infants_clean.R b/R/infants_clean.R index 29d9de6..7819594 100644 --- a/R/infants_clean.R +++ b/R/infants_clean.R @@ -1383,6 +1383,8 @@ cleanbatch_infants <- function(data.df, # 17F # merge with WHO # add the column name we want to grab + df[, who_mindiff_ht := NA] + df[, who_mindiff_ht := NA] for (i in unique(df$whoinc.age.ht[!is.na(df$whoinc.age.ht)])){ cn <- paste0("whoinc.", i, ".ht") df[, who_mindiff_ht := @@ -1432,6 +1434,8 @@ cleanbatch_infants <- function(data.df, # 17K # merge with WHO # add the column name we want to grab + df[, who_mindiff_hc := NA] + df[, who_mindiff_hc := NA] for (i in unique(df$whoinc.age.hc[!is.na(df$whoinc.age.hc)])){ cn <- paste0("whoinc.", i, ".ht") df[, who_mindiff_hc :=