Skip to content

Commit

Permalink
Add preallocation for mindiff
Browse files Browse the repository at this point in the history
  • Loading branch information
delosh653 committed Aug 9, 2023
1 parent 6c4164c commit 623df09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/infants_clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand Down Expand Up @@ -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 :=
Expand Down

0 comments on commit 623df09

Please sign in to comment.