Skip to content

Commit

Permalink
Fixed missing temporary extraneous to includes
Browse files Browse the repository at this point in the history
  • Loading branch information
delosh653 committed Aug 14, 2023
1 parent 0b1445c commit 059c9da
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/infants_clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ cleanbatch_infants <- function(data.df,
# optimize: only perform these steps if this subject is known to have extraneous measurements
if (has.extraneous) {
df[exclude == 'Exclude-Temporary-Extraneous-Same-Day', exclude := 'Include']
df[temporary_extraneous(df), exclude := 'Exclude-Temporary-Extraneous-Same-Day']
df[temporary_extraneous_infants(df), exclude := 'Exclude-Temporary-Extraneous-Same-Day']
}

# 11i. If there was at least one subject who had a potential exclusion identified in step 11c, repeat steps 11b-11g. If there were no subjects with potential
Expand Down Expand Up @@ -844,6 +844,11 @@ cleanbatch_infants <- function(data.df,
}
}

# replace all the "exclude temp extraneous" with includes -- other SDEs
# were removed
exclude_all[exclude_all == "Exclude-Temporary-Extraneous-Same-Day"] <-
"Include"

return(exclude_all)
})(copy(.SD)), by = .(subjid, param), .SDcols = colnames(data.df)]

Expand Down Expand Up @@ -1103,6 +1108,7 @@ cleanbatch_infants <- function(data.df,
testing <- FALSE
}
}

return(exclude_all)
})(copy(.SD)), , by = .(subjid, param), .SDcols = colnames(df)]

Expand Down

0 comments on commit 059c9da

Please sign in to comment.