## This is the check I used to confirm difference between sum() and sumn()

## NOTE TO SELF on usig sum() or sumn() 
##  I ran both and confirmed that any NAs that remain when using sum() are 0 when using sumn() 
##  meaning that when an NA is in a group, the whole group is NA (or 0)
##  However, using sumn() as it is safer in the case that the group is only partially NA
##

{
  DT.cleaned.OSC  <- DT.cleaned[TRUE][label_sc_group %ni% c("RED", "Orchard"), label_sc_group := "OSC"][, lapply(.SD, sumn), keyby=oscCols.meta, .SDcols=oscCols.summing]
  DT.cleaned.OSC2 <- DT.cleaned[TRUE][label_sc_group %ni% c("RED", "Orchard"), label_sc_group := "OSC"][, lapply(.SD, sum ), keyby=oscCols.meta, .SDcols=oscCols.summing]

  ## FALSE is expected here:
  identical(DT.cleaned.OSC, DT.cleaned.OSC2)


  NAs <- (is.na(DT.cleaned.OSC) != is.na(DT.cleaned.OSC2))
  dim(NAs)
  any(NAs)
  wNAs <- which(NAs, arr=TRUE)
  dim(wNAs)
  head(wNAs)
  stopifnot(0 == apply(wNAs, 1, function(x) DT.cleaned.OSC[[x[[2]]]][[x[[1]]]] ))
}