From 16f9dc5bd934a9d67382859d8f2875ef6690c0b1 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Fri, 8 Sep 2023 11:27:53 -0400 Subject: [PATCH] Update "no visible bindings" --- NAMESPACE | 1 + R/growth.R | 7 +++++++ R/infants_clean.R | 18 +++++++++++++++++- R/infants_support.R | 4 ++++ man/read_anthro.Rd | 2 +- 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index e2d3689b..a985f57e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -23,6 +23,7 @@ import(parallel) import(plyr, except = c(failwith, id, summarize, count, desc, mutate, arrange, rename, is.discrete, summarise, summarize)) import(tidyr, except = extract) importFrom(stats,approx) +importFrom(stats,embed) importFrom(stats,median) importFrom(stats,pnorm) importFrom(stats,qnorm) diff --git a/R/growth.R b/R/growth.R index 0f0538f7..a004f191 100644 --- a/R/growth.R +++ b/R/growth.R @@ -165,6 +165,13 @@ cleangrowth <- function(subjid, z.orig_cdc <- z.orig_who <- sd.orig_cdc <- sd.orig_who <- NULL result <- NULL + sd.orig_uncorr <- agemonths <- intwt <- fengadays <- pmagedays <- cagedays <- + unmod_zscore <- fen_wt_m <- fen_wt_l <- fen_wt_s <- cwho_cv <- ccdc_cv <- + sd.c_cdc <- sd.c_who <- sd.c <- sd.corr <- seq_win <- sd.corr_abssumdiff <- + sd.orig_abssumdiff <- ..orig_colnames <- ctbc.sd <- sum_sde <- no_sde <- + sum_val <- no_dup_val <- no_outliers <- no_bigdiff <- nottoofar <- nnte <- + nnte_full <- NULL + # preprocessing ---- # organize data into a dataframe along with a line "index" so the original data order can be recovered diff --git a/R/infants_clean.R b/R/infants_clean.R index c248b682..a1269ace 100644 --- a/R/infants_clean.R +++ b/R/infants_clean.R @@ -15,7 +15,7 @@ #' #' @keywords internal #' @import data.table -#' @importFrom stats median +#' @importFrom stats median embed #' @noRd cleanbatch_infants <- function(data.df, log.path, @@ -58,6 +58,22 @@ cleanbatch_infants <- function(data.df, oob <- sd_med <- med_diff <- max_diff <- sum_oob <- i.exclude <- NULL + + # avoid no visible warning errors + sum_sde <- no_sde <- cf <- wholehalfimp <- seq_win <- cs <- absdiff <- + sd.orig_uncorr <- seq_win <- absdiff <- wholehalfimp <- ageyears <- ctbc.sd <- + ..col_replace <- c.ewma.all <- pot_excl <- c.dewma.all <- p_plus <- + p_minus <- ctbc.sd <- c.ewma.all <- tbc_diff_next <- tbc_diff_prior <- + tbc_diff_plus_next <- tbc.p_plus <- tbc_diff_plus_prior <- + tbc_diff_minus_next <- tbc.p_minus <- tbc_diff_minus_prior <- addcrithigh <- + addcritlow <- tbc_dop <- i.tbc.sd <- rowind <- abssum <- c.dewma.all <- + whoagegrp_ht <- d_agedays <- mindiff <- maxdiff <- who_mindiff_ht <- + who_maxdiff_ht <- mindiff_prev <- maxdiff_prev <- whoinc.age.hc <- + who_maxdiff_hc <- who_mindiff_hc <- diff_prev <- + diff_next <- aft.g.aftm1 <- val_excl <- + absval <- comp_diff <- err_ratio <- + NULL + data.df <- data.table(data.df, key = c('subjid', 'param', 'agedays', 'index')) if (parallel & !is.na(log.path)) { diff --git a/R/infants_support.R b/R/infants_support.R index 57327a97..6ffa5e56 100644 --- a/R/infants_support.R +++ b/R/infants_support.R @@ -154,6 +154,10 @@ calc_oob_evil_twins <- function(df){ #' @keywords internal #' @noRd calc_and_recenter_z_scores <- function(df, cn, ref.data.path){ + # avoid no visible warning errors + cn.orig_cdc <- param <- agedays <- sex <- cn.orig_who <- cn.orig <- subjid <- + tbc.cn <- sd.median <- NULL + # for infants, use z and who measurement.to.z <- read_anthro(ref.data.path, cdc.only = TRUE, infants = TRUE) diff --git a/man/read_anthro.Rd b/man/read_anthro.Rd index 9f185e29..67c17613 100644 --- a/man/read_anthro.Rd +++ b/man/read_anthro.Rd @@ -11,7 +11,7 @@ read_anthro(path = "", cdc.only = FALSE, infants = FALSE) \item{cdc.only}{Whether or not only CDC data should be used. Defaults to false.} -\item{infants}{boolean on if beta infants version is being used. will be merged in to main algorithm.} +\item{infants}{TRUE/FALSE. Run the beta-release of the infants algorithm (expands pediatric algorithm to clean 0 - 2). Defaults to FALSE.} } \value{ Function for calculating BMI based on measurement, age in days, sex, and measurement value.