From babf176fcdc3ecb98f041a45fc3654cbad05047c Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 27 Sep 2022 10:16:50 -0400 Subject: [PATCH 01/67] Add levels for adult data to output factor --- R/growth.R | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/R/growth.R b/R/growth.R index a04d53cd..ab471954 100644 --- a/R/growth.R +++ b/R/growth.R @@ -204,7 +204,7 @@ cleangrowth <- function(subjid, # constants for pediatric # enumerate the different exclusion levels - exclude.levels <- c( + exclude.levels.peds <- c( 'Include', 'Unit-Error-High', 'Unit-Error-Low', @@ -235,6 +235,29 @@ cleangrowth <- function(subjid, 'Exclude-Too-Many-Errors-Other-Parameter' ) + exclude.levels.adult <- c( + "Include", + "Exclude-Adult-BIV", + "Exclude-Adult-Hundreds", + "Exclude-Adult-Unit-Errors", + "Exclude-Adult-Transpositions", + "Exclude-Adult-Weight-Cap-Identical", + "Exclude-Adult-Weight-Cap", + "Exclude-Adult-Swapped-Measurements", + "Exclude-Adult-Identical-Same-Day", + "Exclude-Adult-Extraneous-Same-Day", + "Exclude-Adult-Distinct-Pairs", + "Exclude-Adult-Distinct-3-Or-More", + "Exclude-Adult-EWMA-Extreme", + "Exclude-Adult-Distinct-Ordered-Pairs", + "Exclude-Adult-EWMA-Moderate", + "Exclude-Adult-Possibly-Impacted-By-Weight-Cap", + "Exclude-Adult-Distinct-Single", + "Exclude-Adult-Too-Many-Errors" + ) + + exclude.levels <- base::union(exclude.levels.peds, exclude.levels.adult) + # if there's no pediatric data, no need to go through this rigamarole if (nrow(data.all) > 0){ @@ -665,8 +688,7 @@ cleangrowth <- function(subjid, exclude = c(as.character(ret.df$exclude), res$result), mean_sde = c(rep(NA, nrow(ret.df)), res$mean_sde) ) - full_out[, exclude := factor(exclude, levels = unique(c(exclude.levels, - unique(exclude))))] + full_out[, exclude := factor(exclude, levels = exclude.levels)] full_out <- full_out[order(line),] # remove column added for keeping track full_out[, line := NULL] From 1fe615507d0abcc42e1d662ad93abaaedec26aaf Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Fri, 7 Oct 2022 13:44:30 -0400 Subject: [PATCH 02/67] Minor code reformat via RStudio, prepping for comparison, refs #98 --- R/cdc.R | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/R/cdc.R b/R/cdc.R index 0449adb1..308d8f83 100644 --- a/R/cdc.R +++ b/R/cdc.R @@ -211,7 +211,20 @@ ext_bmiz <- function(data, dref[agemos == 240, .(sex, mbmi, sbmi)] %>% setnames(., c("sex", "mref", "sref")) dref <- dref[adj_bmi_met, on = 'sex'] - v <- c("sex", "age", "wl", "wm", "ws", "bl", "bm", "bs", "hl", "hm", "hs", "mref", "sref") + v <- + c("sex", + "age", + "wl", + "wm", + "ws", + "bl", + "bm", + "bs", + "hl", + "hm", + "hs", + "mref", + "sref") setnames(dref, v) # interpolate reference data to match each agemos in input data @@ -280,7 +293,20 @@ ext_bmiz <- function(data, dt[, (x) := NULL] setnames( dt, - c("adist1", "aperc1", "bp", "bz", "mbz", "mwaz", "mhaz", "ebp", "ebz", "l", "m", "s"), + c( + "adist1", + "aperc1", + "bp", + "bz", + "mbz", + "mwaz", + "mhaz", + "ebp", + "ebz", + "l", + "m", + "s" + ), c( "adj_dist1", "adj_perc1", From cb4e20aee850c6c59e5c7f0abec0feaa15c88b8c Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Fri, 7 Oct 2022 13:47:06 -0400 Subject: [PATCH 03/67] Updated code from David Freedman, reformatted via RStudio, refs #98 --- R/cdc.R | 472 +++++++++++++++++++++++++++----------------------------- 1 file changed, 228 insertions(+), 244 deletions(-) diff --git a/R/cdc.R b/R/cdc.R index 308d8f83..499a2120 100644 --- a/R/cdc.R +++ b/R/cdc.R @@ -127,256 +127,240 @@ set_cols_first <- function(DT, cols, intersection = TRUE) #' # Disabling conversion of all-integer age in months to (age + 0.5) #' dfc <- simple_bmi(df_wide) #' df_bmiz <- ext_bmiz(dfc, adjust.integer.age=FALSE) -ext_bmiz <- function(data, - age = "agem", - wt = "wt", - ht = "ht", - bmi = "bmi", - adjust.integer.age = TRUE, - ref.data.path = "") { - # avoid "no visible binding" warnings - agemos <- agemos1 <- agemos2 <- agey <- NULL - bmip95 <- bp <- bz <- denom <- ebp <- ebz <- haz <- l <- NULL - lbmi1 <- lbmi2 <- lht1 <- lht2 <- lwt1 <- lwt2 <- m <- NULL - mbmi <- mbmi1 <- mbmi2 <- mht1 <- mht2 <- mref <- mwt1 <- NULL - mwt2 <- p95 <- s <- sbmi <- sbmi1 <- sbmi2 <- seq_ <- NULL - sex <- sht1 <- sht2 <- sigma <- sref <- swt1 <- NULL - swt2 <- waz <- z1 <- `_AGEMOS1` <- NULL - - setDT(data) - - setnames(data, - old = c(age, wt, ht, bmi), - new = c('age', 'wt', 'ht', 'bmi')) - - # needed for merging back with original data - data$seq_ <- 1L:nrow(data) - dorig <- copy(data) - - # Adjust integer values only if specified (default) and all values are integer - if (adjust.integer.age) { - if (isTRUE(all.equal(data$age, round(data$age)))) { - data[, age := age + 0.5] +ext_bmiz <- function (data, + age = "agem", + wt = "wt", + ht = "ht", + bmi = "bmi", + adjust.integer.age = TRUE, + ref.data.path = "") + { + agemos <- agemos1 <- agemos2 <- agey <- NULL + bmip95 <- bp <- bz <- denom <- ebp <- ebz <- haz <- l <- NULL + lbmi1 <- lbmi2 <- lht1 <- lht2 <- lwt1 <- lwt2 <- m <- NULL + mbmi <- mbmi1 <- mbmi2 <- mht1 <- mht2 <- mref <- mwt1 <- NULL + mwt2 <- p95 <- s <- sbmi <- sbmi1 <- sbmi2 <- seq_ <- NULL + sex <- sht1 <- sht2 <- sigma <- sref <- swt1 <- NULL + swt2 <- waz <- z1 <- `_AGEMOS1` <- NULL + setDT(data) + setnames(data, + old = c(age, wt, ht, bmi), + new = c("age", + "wt", "ht", "bmi")) + data$seq_ <- 1L:nrow(data) + dorig <- copy(data) + if (adjust.integer.age) { + if (isTRUE(all.equal(data$age, round(data$age)))) { + data[, `:=`(age, age + 0.5)] + } } - } - - data <- data[between(age, 24, 240) & !(is.na(wt) & is.na(ht)), - .(seq_, sex, age, wt, ht, bmi)] - - v1 <- c("seq_", "id", "sex", "age", "wt", "ht", "bmi") - dref_path <- ifelse( - ref.data.path == "", - system.file("extdata/CDCref_d.csv.gz", package = "growthcleanr"), - paste(ref.data.path, "CDCref_d.csv.gz", sep = "") - ) - # Note: referring to underscore-leading column as `_AGEMOS1`, i.e. with - # backticks, results in a no visible binding warning, but vars can't start - # with an "_", so we have to use backticks at assignment up above as well. - dref <- - fread(dref_path)[`_AGEMOS1` > 23 & denom == 'age'] - names(dref) <- tolower(names(dref)) - names(dref) <- gsub('^_', '', names(dref)) + # DF changes (and then replace 'sex' with 'sexn' thoughout (which I've done): + data[, sexn := toupper(substr(sex, 1, 1))] + data[, sexn := fcase(sexn %in% c(1, 'B', 'M'), 1L, + sexn %in% c(2, 'G', 'F'), 2L)] - d20 <- dref[agemos2 == 240, - .(sex, - agemos2, - lwt2, - mwt2, - swt2, - lbmi2, - mbmi2, - sbmi2, - lht2, - mht2, - sht2)] - names(d20) <- gsub('2', '', names(d20)) + data <- data[between(age, 24, 240) & !(is.na(wt) & is.na(ht)), + .(seq_, sexn, age, wt, ht, bmi)] # DF changes change sex to sexn + v1 <- c("seq_", "id", "sexn", "age", "wt", "ht", "bmi") + dref_path <- + ifelse( + ref.data.path == "", + system.file("extdata/CDCref_d.csv.gz", + package = "growthcleanr"), + paste(ref.data.path, "CDCref_d.csv.gz", + sep = "") + ) + dref <- fread(dref_path)[`_AGEMOS1` > 23 & denom == "age"] + names(dref) <- tolower(names(dref)) + names(dref) <- gsub("^_", "", names(dref)) + setnames(dref, 'sex', 'sexn') # DF changes - dref <- - dref[, .(sex, - agemos1, - lwt1, - mwt1, - swt1, - lbmi1, - mbmi1, - sbmi1, - lht1, - mht1, - sht1)] - names(dref) <- gsub('1', '', names(dref)) - - dref <- rbindlist(list(dref, d20)) - adj_bmi_met <- - dref[agemos == 240, .(sex, mbmi, sbmi)] %>% setnames(., c("sex", "mref", "sref")) - - dref <- dref[adj_bmi_met, on = 'sex'] - v <- - c("sex", - "age", - "wl", - "wm", - "ws", - "bl", - "bm", - "bs", - "hl", - "hm", - "hs", - "mref", - "sref") - setnames(dref, v) - - # interpolate reference data to match each agemos in input data - if (length(setdiff(data$age, dref$age)) > 0) { - uages <- unique(data$age) - fapprox <- function(i) { - .d <- dref[sex == i] - fapp <- function(vars, ...) - approx(.d$age, vars, xout = uages)$y - # Note: specifying v with "..v" gives no visible binding warning, use with option - data.frame(sapply(.d[, v, with = FALSE], fapp)) + d20 <- dref[agemos2 == 240, .(sexn, + agemos2, + lwt2, + mwt2, + swt2, + lbmi2, + mbmi2, + sbmi2, + lht2, + mht2, + sht2)] + names(d20) <- gsub("2", "", names(d20)) + dref <- dref[, .(sexn, + agemos1, + lwt1, + mwt1, + swt1, + lbmi1, + mbmi1, + sbmi1, + lht1, + mht1, + sht1)] + names(dref) <- gsub("1", "", names(dref)) + dref <- rbindlist(list(dref, d20)) + adj_bmi_met <- dref[agemos == 240, .(sexn, mbmi, sbmi)] %>% + setnames(., c("sexn", "mref", "sref")) + dref <- dref[adj_bmi_met, on = "sexn"] + v <- c("sexn", + "age", + "wl", + "wm", + "ws", + "bl", + "bm", + "bs", + "hl", + "hm", + "hs", + "mref", + "sref") + setnames(dref, v) + if (length(setdiff(data$age, dref$age)) > 0) { + uages <- unique(data$age) + fapprox <- function(i) { + .d <- dref[sexn == i] + fapp <- function(vars, ...) + approx(.d$age, vars, + xout = uages)$y + data.frame(sapply(.d[, v, with = FALSE], fapp)) + } + dref <- rbindlist(lapply(1:2, fapprox)) } - dref <- rbindlist(lapply(1:2, fapprox)) - } - - setkey(data, sex, age) - setkey(dref, sex, age) - dt <- dref[data] - - dt[, c("waz", "mwaz") := z_score(dt$wt, dt$wl, dt$wm, dt$ws)] - dt[, c("haz", "mhaz") := z_score(dt$ht, dt$hl, dt$hm, dt$hs)] - dt[, c("bz", "mbz") := z_score(dt$bmi, dt$bl, dt$bm, dt$bs)] - - setDT(dt) - setnames(dt, c("bl", "bm", "bs"), c("l", "m", "s")) - dt[, c("wl", "wm", "ws", "hl", "hm", "hs") := NULL] - - dt <- mutate( - dt, - bp = 100 * pnorm(bz), - p95 = m * (1 + l * s * qnorm(0.95)) ^ (1 / l), - p97 = m * (1 + l * s * qnorm(0.97)) ^ (1 / l), - bmip95 = 100 * (bmi / p95), - wp = 100 * pnorm(waz), - hp = 100 * pnorm(haz), - - # other BMI metrics -- PMID 31439056 - z1 = ((bmi / m) - 1) / s, - # LMS formula when L=1: ((BMI/M)-1)/S - dist1 = z1 * m * s, - # unadjusted distance from median - adist1 = z1 * sref * mref, - # Adjusted (to age 20y) dist from median - perc1 = z1 * 100 * s, - # unadjusted %distance from median - aperc1 = z1 * 100 * sref, - # adj %distance from median - - obese = 1L * (bmi >= p95), - sev_obese = 1L * (bmip95 >= 120) - ) %>% setDT() - - ## now create Extended z-score for BMI >=95th P - dt[, ':=' (ebz = bz, - ebp = bp, - agey = age / 12)] - dt[, sigma := fifelse(sex == 1, - 0.3728 + 0.5196 * agey - 0.0091 * agey ^ 2, - 0.8334 + 0.3712 * agey - 0.0011 * agey ^ 2)] - dt[bp >= 95, ebp := 90 + 10 * pnorm((bmi - p95) / sigma)] - dt[bp >= 95, ebz := qnorm(ebp / 100)] - dt[bp > 99 & - is.infinite(ebz), ebz := 8.21] # highest poss value is 8.20945 - - x <- c("agey", "mref", "sref", "sex", "wt", "ht", "bmi") - dt[, (x) := NULL] - setnames( - dt, - c( - "adist1", - "aperc1", - "bp", - "bz", - "mbz", - "mwaz", - "mhaz", - "ebp", - "ebz", - "l", - "m", - "s" - ), - c( - "adj_dist1", - "adj_perc1", - "bmip", + setkey(data, sexn, age) + setkey(dref, sexn, age) + dt <- dref[data] + dt[, `:=`(c("waz", "mwaz"), z_score(dt$wt, dt$wl, dt$wm, + dt$ws))] + dt[, `:=`(c("haz", "mhaz"), z_score(dt$ht, dt$hl, dt$hm, + dt$hs))] + dt[, `:=`(c("bz", "mbz"), z_score(dt$bmi, dt$bl, dt$bm, dt$bs))] + setDT(dt) + setnames(dt, c("bl", "bm", "bs"), c("l", "m", "s")) + dt[, `:=`(c("wl", "wm", "ws", "hl", "hm", "hs"), NULL)] + dt <- mutate( + dt, + bp = 100 * pnorm(bz), + p95 = m * (1 + l * + s * qnorm(0.95)) ^ + (1 / l), + p97 = m * (1 + l * s * qnorm(0.97)) ^ (1 / l), + bmip95 = 100 * (bmi / p95), + wp = 100 * pnorm(waz), + hp = 100 * + pnorm(haz), + z1 = ((bmi / m) - 1) / s, + dist1 = z1 * m * + s, + adist1 = z1 * sref * mref, + perc1 = z1 * 100 * + s, + aperc1 = z1 * 100 * sref, + obese = 1L * (bmi >= + p95), + sev_obese = 1L * (bmip95 >= 120) + ) %>% setDT() + dt[, `:=`(ebz = bz, + ebp = bp, + agey = age / 12)] + dt[, `:=`( + sigma, + fifelse( + sexn == 1, + 0.3728 + 0.5196 * agey - + 0.0091 * agey ^ 2, + 0.8334 + 0.3712 * agey - 0.0011 * agey ^ 2 + ) + )] + dt[bp >= 95, `:=`(ebp, 90 + 10 * pnorm((bmi - p95) / sigma))] + dt[bp >= 95, `:=`(ebz, qnorm(ebp / 100))] + dt[bp > 99 & is.infinite(ebz), `:=`(ebz, 8.21)] + x <- c("agey", "mref", "sref", "sexn", "wt", "ht", "bmi") + dt[, `:=`((x), NULL)] + setnames( + dt, + c( + "adist1", + "aperc1", + "bp", + "bz", + "mbz", + "mwaz", + "mhaz", + "ebp", + "ebz", + "l", + "m", + "s" + ), + c( + "adj_dist1", + "adj_perc1", + "original_bmip", + "original_bmiz", + "mod_bmiz", + "mod_waz", + "mod_haz", + # DF changes + "bmip", + "bmiz", + "bmi_l", + "bmi_m", + "bmi_s" + ) + ) # DF changes + v <- c( + "seq_", "bmiz", + "bmip", + "waz", + "wp", + "haz", + "hp", + "p95", + "p97", + "bmip95", "mod_bmiz", "mod_waz", "mod_haz", - "ext_bmip", - "ext_bmiz", - "bmi_l", - "bmi_m", - "bmi_s" - ) - ) - - # Note: removing distance from median metrics; can restore - - v <- c( - "seq_", - "bmiz", - "bmip", - "waz", - "wp", - "haz", - "hp", - "p95", - "p97", - "bmip95", - "mod_bmiz", - "mod_waz", - "mod_haz", - "sigma", - "ext_bmip", - "ext_bmiz", - "sev_obese", - "obese" - ) - dt <- dt[, v, with = FALSE] - - setkey(dt, seq_) - setkey(dorig, seq_) - dtot <- dt[dorig] - set_cols_first(dtot, names(dorig)) - dtot[, c("seq_") := NULL] - - # Add labels for convenience - dtot <- dtot %>% labelled::set_variable_labels( - age = 'Age (months)', - ht = 'Height (cm)', - wt = 'Weight (kg)', - bmi = 'BMI', - bmiz = 'LMS BMI-for-sex/age z-score', - bmip = 'LMS BMI-for-sex/age percentile', - waz = 'LMS Weight-for-sex/age z-score', - wp = 'LMS Weight-for-sex/age percentile', - haz = 'LMS Height-for-sex/age z-score', - hp = 'LMS Height-for-sex/age percentile', - p95 = '95th percentile of BMI in growth charts', - p97 = '97th percentile of BMI in growth charts', - bmip95 = 'BMI as a percentage of the 95th percentile', - mod_bmiz = 'Modified BMI-for-age z-score', - mod_waz = 'Modified Weight-for-age z-score', - mod_haz = 'Modified Height-for-age z-score', - sigma = 'Scale parameter for half-normal distribution', - ext_bmip = 'Extended BMI percentile', - ext_bmiz = 'Extended BMI z-score', - sev_obese = 'BMI >= 120% of 95th percentile (0/1)', - obese = 'BMI >= 95th percentile (0/1)' - ) - - return(dtot[]) -} + "sigma", + "original_bmip", + "original_bmiz", + "sev_obese", + "obese" + ) # DF changes + dt <- dt[, v, with = FALSE] + setkey(dt, seq_) + setkey(dorig, seq_) + dtot <- dt[dorig] + set_cols_first(dtot, names(dorig)) + dtot[, `:=`(c("seq_"), NULL)] + dtot <- + dtot %>% labelled::set_variable_labels( + age = "Age (months)", + ht = "Height (cm)", + wt = "Weight (kg)", + bmi = "BMI", + original_bmiz = "LMS BMI-for-sex/age z-score", + original_bmip = "LMS BMI-for-sex/age percentile", + waz = "LMS Weight-for-sex/age z-score", + wp = "LMS Weight-for-sex/age percentile", + haz = "LMS Height-for-sex/age z-score", + hp = "LMS Height-for-sex/age percentile", + p95 = "95th percentile of BMI in growth charts", + p97 = "97th percentile of BMI in growth charts", + bmip95 = "BMI as a percentage of the 95th percentile", + mod_bmiz = "Modified BMI-for-age z-score", + mod_waz = "Modified Weight-for-age z-score", + mod_haz = "Modified Height-for-age z-score", + sigma = "Scale parameter for half-normal distribution", + bmip = "LMS / Extended BMI percentile", + bmiz = "LMS / Extended BMI z-score", + # DF changes + sev_obese = "BMI >= 120% of 95th percentile (0/1)", + obese = "BMI >= 95th percentile (0/1)" + ) + return(dtot[]) + } From 8a4a2081e14ef71f12a6eb1a21487a8d61759bbc Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Tue, 18 Oct 2022 17:46:36 -0400 Subject: [PATCH 04/67] adding default docker-publish.yml workflow, refs #101 --- .github/workflows/docker-publish.yml | 96 ++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 00000000..4a322ede --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,96 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + schedule: + - cron: '36 4 * * *' + push: + branches: [ "main" ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "main" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0 + with: + cosign-release: 'v1.11.0' + + + # Workaround: https://github.com/docker/build-push-action/issues/461 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + COSIGN_EXPERIMENTAL: "true" + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }} From c3a3dea1362f02d8f9b423907b1acb21d51403e9 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Tue, 18 Oct 2022 17:59:49 -0400 Subject: [PATCH 05/67] temporarily test login/publish on pull request, refs #101 --- .github/workflows/docker-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 4a322ede..dd754256 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -40,7 +40,7 @@ jobs: # Install the cosign tool except on PR # https://github.com/sigstore/cosign-installer - name: Install cosign - if: github.event_name != 'pull_request' + # if: github.event_name != 'pull_request' uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0 with: cosign-release: 'v1.11.0' @@ -53,7 +53,7 @@ jobs: # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' + # if: github.event_name != 'pull_request' uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c with: registry: ${{ env.REGISTRY }} @@ -75,7 +75,7 @@ jobs: uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a with: context: . - push: ${{ github.event_name != 'pull_request' }} + # push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha @@ -88,7 +88,7 @@ jobs: # transparency data even for private images, pass --force to cosign below. # https://github.com/sigstore/cosign - name: Sign the published Docker image - if: ${{ github.event_name != 'pull_request' }} + # if: ${{ github.event_name != 'pull_request' }} env: COSIGN_EXPERIMENTAL: "true" # This step uses the identity token to provision an ephemeral certificate From a0b9a15fe0da99a642a244a6fb2f6b2f75225438 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Tue, 18 Oct 2022 18:04:08 -0400 Subject: [PATCH 06/67] add ticket branch for build push testing, refs #101 --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index dd754256..efc2d287 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -9,7 +9,7 @@ on: schedule: - cron: '36 4 * * *' push: - branches: [ "main" ] + branches: [ "main", "t101-update-container-builds" ] # Publish semver tags as releases. tags: [ 'v*.*.*' ] pull_request: From cd1058d70313b5c05f7b1f9ebdc23ea0ad52b39e Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Tue, 18 Oct 2022 18:19:16 -0400 Subject: [PATCH 07/67] removing pull request support, refs #101 --- .github/workflows/docker-publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index efc2d287..4a322ede 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -9,7 +9,7 @@ on: schedule: - cron: '36 4 * * *' push: - branches: [ "main", "t101-update-container-builds" ] + branches: [ "main" ] # Publish semver tags as releases. tags: [ 'v*.*.*' ] pull_request: @@ -40,7 +40,7 @@ jobs: # Install the cosign tool except on PR # https://github.com/sigstore/cosign-installer - name: Install cosign - # if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0 with: cosign-release: 'v1.11.0' @@ -53,7 +53,7 @@ jobs: # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} - # if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c with: registry: ${{ env.REGISTRY }} @@ -75,7 +75,7 @@ jobs: uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a with: context: . - # push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha @@ -88,7 +88,7 @@ jobs: # transparency data even for private images, pass --force to cosign below. # https://github.com/sigstore/cosign - name: Sign the published Docker image - # if: ${{ github.event_name != 'pull_request' }} + if: ${{ github.event_name != 'pull_request' }} env: COSIGN_EXPERIMENTAL: "true" # This step uses the identity token to provision an ephemeral certificate From a56676fab3efad905a89ee407d34193d843c3867 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Tue, 18 Oct 2022 18:34:57 -0400 Subject: [PATCH 08/67] updated action references, refs #101 --- .github/workflows/docker-publish.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 4a322ede..5e8ea8aa 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,4 +1,4 @@ -name: Docker +name: image-build-and-push # This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by @@ -7,13 +7,13 @@ name: Docker on: schedule: - - cron: '36 4 * * *' + - cron: $cron-daily push: - branches: [ "main" ] + branches: [ $default-branch ] # Publish semver tags as releases. tags: [ 'v*.*.*' ] pull_request: - branches: [ "main" ] + branches: [ $default-branch ] env: # Use docker.io for Docker Hub if empty @@ -48,13 +48,13 @@ jobs: # Workaround: https://github.com/docker/build-push-action/issues/461 - name: Setup Docker buildx - uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf + uses: docker/setup-buildx-action@v2 # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -64,7 +64,7 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} @@ -72,7 +72,7 @@ jobs: # https://github.com/docker/build-push-action - name: Build and push Docker image id: build-and-push - uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a + uses: docker/build-push-action@v4 with: context: . push: ${{ github.event_name != 'pull_request' }} From d2cd18e469e51fe61fbdd223d4d4a39352c50033 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Tue, 18 Oct 2022 18:36:59 -0400 Subject: [PATCH 09/67] fixing cron schedule, refs #101 --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5e8ea8aa..f08644ff 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -7,7 +7,7 @@ name: image-build-and-push on: schedule: - - cron: $cron-daily + - cron: '56 4 * * *' push: branches: [ $default-branch ] # Publish semver tags as releases. From c7ef75c0437091e6863b4fcb68236f5b908bdd44 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Tue, 18 Oct 2022 18:43:35 -0400 Subject: [PATCH 10/67] renamed workflow, something was off, refs #101 --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f08644ff..ee4a14de 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,4 +1,4 @@ -name: image-build-and-push +name: Docker # This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by From a00af7f2c026e38b3c374bfa15054eaf33112af5 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 1 Nov 2022 12:41:49 -0400 Subject: [PATCH 11/67] Add cran release checklist to advanced options --- _pkgdown.yml | 1 + vignettes/developer-guidelines.Rmd | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 vignettes/developer-guidelines.Rmd diff --git a/_pkgdown.yml b/_pkgdown.yml index 7934b0f6..8a0c688e 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -19,6 +19,7 @@ articles: - utilities - large-data-sets - next-steps + - developer-guidelines reference: - title: "Cleaning height and weight observations" diff --git a/vignettes/developer-guidelines.Rmd b/vignettes/developer-guidelines.Rmd new file mode 100644 index 00000000..f3422d5d --- /dev/null +++ b/vignettes/developer-guidelines.Rmd @@ -0,0 +1,20 @@ +--- +title: "Developer Guidelines" +date: "`r Sys.Date()`" +vignette: > + %\VignetteIndexEntry{Developer Guidelines} %\VignetteEngine{knitr::rmarkdown} + %\usepackage[utf8]{inputenc} +--- + +## CRAN Release Checklist + +When deploying updates to CRAN, here a few updates that you need to check off before doing so: + +- Update version number in DESCRIPTION in format major.minor.patch (e.g. 1.2.1) +- Update documentation with `devtools::document()` +- Run `devtools::check()`: + - If any problems come up that have not previously been documented in `cran-comments.md` and cannot be fixed, fix them. There should be no ERRORs or WARNINGs before submitting to CRAN. + - Look through past CRAN submissions to make sure you haven't reintroduced a bug/note that has been addressed in a previous version +- Update NEWS.md with version updates +- Update cran-comments.md in format +- After the branch is merged, create a GitHub release From f9656f18459887f720dfae4357fb29bcb70448cd Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 1 Nov 2022 12:45:45 -0400 Subject: [PATCH 12/67] Update version number & maintainer --- DESCRIPTION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1fa7b46b..7cf5478e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,14 @@ Package: growthcleanr Type: Package Title: Data Cleaner for Anthropometric Measurements -Version: 2.0.2 +Version: 2.0.3 Authors@R: c( - person("Daymont","Carrie", email = "cdaymont@pennstatehealth.psu.edu", role = "aut"), + person("Daymont","Carrie", email = "cdaymont@pennstatehealth.psu.edu", role = c("ctb","cre")), person("Grundmeier","Robert", role = "aut"), person("Miller","Jeffrey", role = "aut"), person("Campos","Diego", role = "aut"), person("Chudnov","Dan", role = "ctb"), - person("De los Santos","Hannah", email = "hdelossantos@mitre.org", role = c("ctb","cre")), + person("De los Santos","Hannah", email = "hdelossantos@mitre.org", role = c("ctb")), person("Cao","Lusha", role = "ctb"), person("Silva","Steffani", role = "ctb"), person("Zhang","Hanzhe", role = "ctb"), From fc82bfcb89c9acf63c6b64a98c36c1f5d77cc695 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 1 Nov 2022 12:58:05 -0400 Subject: [PATCH 13/67] Update news --- NEWS.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS.md b/NEWS.md index dd21b011..4b455647 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,14 @@ +# growthcleanr 2.0.3 - 2022-11-01 + +## Added + +- CRAN release checklist now added under Developer Guidelines vignette + +## Changed + +- All possible levels for `cleangrowth()` output factor now enumerated +- Updated maintainer to Carrie Daymont + # growthcleanr 2.0.2 - 2022-09-13 ## Added From 732080736f4f5d5343704af1f4588337df4927be Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 1 Nov 2022 13:00:14 -0400 Subject: [PATCH 14/67] Update CRAN comments --- cran-comments.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cran-comments.md b/cran-comments.md index f05f7830..16d8dd9b 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,4 +1,4 @@ -# CRAN submission growthcleanr 2.0.2 (1) +# CRAN submission growthcleanr 2.0.3 ## R CMD check results There were no ERRORs, WARNINGs, or NOTEs. @@ -6,8 +6,18 @@ There were no ERRORs, WARNINGs, or NOTEs. ## Downstream dependencies There are currently no downstream dependencies for this package. + + # Previous Submissions +# CRAN submission growthcleanr 2.0.2 (1) + +## R CMD check results +There were no ERRORs, WARNINGs, or NOTEs. + +## Downstream dependencies +There are currently no downstream dependencies for this package. + # CRAN submission growthcleanr 2.0.1 (6) ## R CMD check results From 8c2b902b7d99bb20a5ece6bbca26c9c2e4c129e5 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 1 Nov 2022 13:16:35 -0400 Subject: [PATCH 15/67] Add submit to CRAN! --- vignettes/developer-guidelines.Rmd | 1 + 1 file changed, 1 insertion(+) diff --git a/vignettes/developer-guidelines.Rmd b/vignettes/developer-guidelines.Rmd index f3422d5d..66c57135 100644 --- a/vignettes/developer-guidelines.Rmd +++ b/vignettes/developer-guidelines.Rmd @@ -18,3 +18,4 @@ When deploying updates to CRAN, here a few updates that you need to check off be - Update NEWS.md with version updates - Update cran-comments.md in format - After the branch is merged, create a GitHub release +- After the branch is merged, submit to CRAN with previously written comments! From 223f363d63c035dba16a8a2b8330e43ee3f31e0c Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 1 Nov 2022 13:25:06 -0400 Subject: [PATCH 16/67] Update readme --- README.Rmd | 1 + README.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.Rmd b/README.Rmd index 0e3bed1b..d8c401b0 100644 --- a/README.Rmd +++ b/README.Rmd @@ -102,6 +102,7 @@ The rest of this documentation includes: notes and suggestions for running `growthcleanr` with large data sources - [Next steps](https://carriedaymont.github.io/growthcleanr/articles/next-steps.html), notes on potential enhancements to the pediatric and adult algorithms +- [Developer Guidelines](https://carriedaymont.github.io/growthcleanr/articles/developer-guidelines.html), advice for contributors to this package, including a CRAN release checklist ## Changes diff --git a/README.md b/README.md index d4e72327..2f9ad4d7 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,10 @@ The rest of this documentation includes: - [Next steps](https://carriedaymont.github.io/growthcleanr/articles/next-steps.html), notes on potential enhancements to the pediatric and adult algorithms +- [Developer + Guidelines](https://carriedaymont.github.io/growthcleanr/articles/developer-guidelines.html), + advice for contributors to this package, including a CRAN release + checklist ## Changes From babd8ef23b6903d0d9a6a4c55a2ca8011915d05e Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Wed, 2 Nov 2022 08:28:59 -0400 Subject: [PATCH 17/67] Install via CRAN instead of GitHub, refs #101 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 810ba567..5859050e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN mkdir /app/R_libs RUN echo "R_LIBS_USER=/app/R_libs" > /home/gcuser/.Renviron RUN echo ".libPaths(c('/app/R_libs', .libPaths()))" > /home/gcuser/.Rprofile -RUN R -e "devtools::install_github('mitre/growthcleanr', dependencies = TRUE, ref = 'main', lib='/app/R_libs')" +RUN R -e "install.packages('growthcleanr', dependencies = TRUE, lib='/app/R_libs')" ADD exec/gcdriver.R /usr/local/bin/ RUN chmod ugo+rx /usr/local/bin/gcdriver.R From 5129307625a58d7957bef9cd6e34ea6f1db4b6cf Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Wed, 2 Nov 2022 08:29:34 -0400 Subject: [PATCH 18/67] Add image badge, refs #101 --- README.Rmd | 1 + 1 file changed, 1 insertion(+) diff --git a/README.Rmd b/README.Rmd index 0e3bed1b..cd748c22 100644 --- a/README.Rmd +++ b/README.Rmd @@ -19,6 +19,7 @@ knitr::opts_chunk$set( [![CRAN status](https://www.r-pkg.org/badges/version/growthcleanr) ](https://cran.r-project.org/package=growthcleanr) [![R build status](https://github.com/carriedaymont/growthcleanr/workflows/R-CMD-check/badge.svg) ](https://github.com/carriedaymont/growthcleanr/actions) +[![Docker](https://github.com/carriedaymont/growthcleanr/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/carriedaymont/growthcleanr/actions/workflows/docker-publish.yml) From c90c1e09ae51891f677aeb2d5485f41c10a6de62 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Wed, 2 Nov 2022 13:13:56 -0400 Subject: [PATCH 19/67] Add ticket to news --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 4b455647..cfdeccaf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ ## Added -- CRAN release checklist now added under Developer Guidelines vignette +- CRAN release checklist now added under Developer Guidelines vignette (#99) ## Changed From bf43efd46a9c15b7fe00fd81fca955ff7a8a21e0 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Wed, 2 Nov 2022 13:16:13 -0400 Subject: [PATCH 20/67] Lowercase guidelines --- README.Rmd | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.Rmd b/README.Rmd index d8c401b0..e611469e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -102,7 +102,7 @@ The rest of this documentation includes: notes and suggestions for running `growthcleanr` with large data sources - [Next steps](https://carriedaymont.github.io/growthcleanr/articles/next-steps.html), notes on potential enhancements to the pediatric and adult algorithms -- [Developer Guidelines](https://carriedaymont.github.io/growthcleanr/articles/developer-guidelines.html), advice for contributors to this package, including a CRAN release checklist +- [Developer guidelines](https://carriedaymont.github.io/growthcleanr/articles/developer-guidelines.html), advice for contributors to this package, including a CRAN release checklist ## Changes diff --git a/README.md b/README.md index 2f9ad4d7..01d3a0c7 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ The rest of this documentation includes: steps](https://carriedaymont.github.io/growthcleanr/articles/next-steps.html), notes on potential enhancements to the pediatric and adult algorithms - [Developer - Guidelines](https://carriedaymont.github.io/growthcleanr/articles/developer-guidelines.html), + guidelines](https://carriedaymont.github.io/growthcleanr/articles/developer-guidelines.html), advice for contributors to this package, including a CRAN release checklist From 54a3de0562c19657f85a4821ae1b9dad3858e3d8 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Wed, 2 Nov 2022 13:28:01 -0400 Subject: [PATCH 21/67] Update pkgdown site and specify in guidelines --- docs/404.html | 7 +- docs/LICENSE-text.html | 30 +- docs/LICENSE.html | 124 +++++ docs/articles/adult-algorithm.html | 7 +- docs/articles/configuration.html | 11 +- docs/articles/developer-guidelines.html | 189 +++++++ docs/articles/index.html | 9 +- docs/articles/installation.html | 78 +-- docs/articles/large-data-sets.html | 9 +- docs/articles/next-steps.html | 7 +- docs/articles/output.html | 7 +- docs/articles/quickstart.html | 33 +- docs/articles/usage.html | 9 +- docs/articles/utilities.html | 7 +- docs/authors.html | 11 +- docs/index.html | 32 +- docs/news/index.html | 35 +- docs/pkgdown.yml | 5 +- docs/reference/CDCref_d.html | 7 +- docs/reference/acf_answers.html | 261 ++++----- docs/reference/adjustcarryforward.html | 402 ++++++-------- docs/reference/bmianthro.html | 7 +- docs/reference/cleangrowth.html | 506 ++++++++---------- docs/reference/ewma.html | 218 +++----- docs/reference/ext_bmiz.html | 272 ++++------ docs/reference/growth_cdc_ext.html | 7 +- docs/reference/index.html | 7 +- docs/reference/lenanthro.html | 7 +- docs/reference/longwide.html | 289 ++++------ docs/reference/nhanes-reference-medians.html | 7 +- docs/reference/read_anthro.html | 181 ++----- docs/reference/recode_sex.html | 249 ++++----- docs/reference/sd_median.html | 219 +++----- docs/reference/simple_bmi.html | 217 +++----- docs/reference/splitinput.html | 238 +++----- docs/reference/syngrowth.html | 140 ++--- docs/reference/tanner_ht_vel.html | 7 +- docs/reference/tanner_ht_vel_with_2sd.html | 7 +- .../test_syngrowth_sas_output_compare.html | 7 +- docs/reference/test_syngrowth_wide.html | 7 +- docs/reference/testacf.html | 15 +- docs/reference/weianthro.html | 7 +- docs/reference/who_ht_maxvel.html | 7 +- docs/reference/who_ht_maxvel_2sd.html | 7 +- docs/reference/who_ht_vel_2sd.html | 7 +- docs/reference/who_ht_vel_3sd.html | 7 +- docs/sitemap.xml | 22 +- vignettes/developer-guidelines.Rmd | 6 +- 48 files changed, 1792 insertions(+), 2158 deletions(-) create mode 100644 docs/LICENSE.html create mode 100644 docs/articles/developer-guidelines.html diff --git a/docs/404.html b/docs/404.html index 137d06cc..29e132b4 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ growthcleanr - 2.0.1 + 2.0.3 @@ -78,6 +78,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -125,7 +128,7 @@

    Page not found (404)

    diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index f1e5dacf..a3b044cb 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -84,27 +87,8 @@

    License

    -
    MIT License
    -
    -Copyright (c) 2018-2022 Carrie Daymont
    -
    -Permission is hereby granted, free of charge, to any person obtaining a copy
    -of this software and associated documentation files (the "Software"), to deal
    -in the Software without restriction, including without limitation the rights
    -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    -copies of the Software, and to permit persons to whom the Software is
    -furnished to do so, subject to the following conditions:
    -
    -The above copyright notice and this permission notice shall be included in all
    -copies or substantial portions of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    -SOFTWARE.
    +
    YEAR: 2022
    +COPYRIGHT HOLDER: Carrie Daymont
     
    @@ -118,7 +102,7 @@

    License

    diff --git a/docs/LICENSE.html b/docs/LICENSE.html new file mode 100644 index 00000000..df4d5ec6 --- /dev/null +++ b/docs/LICENSE.html @@ -0,0 +1,124 @@ + +MIT License • growthcleanr + + +
    +
    + + + +
    +
    + + +
    + +

    Copyright (c) 2022, Carrie Daymont

    +

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    +

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    +

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    +
    + +
    + + + +
    + + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/articles/adult-algorithm.html b/docs/articles/adult-algorithm.html index 1f3cb5d1..7fe212ad 100644 --- a/docs/articles/adult-algorithm.html +++ b/docs/articles/adult-algorithm.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -110,7 +113,7 @@ @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -110,7 +113,7 @@
  • error.load.mincount - default 2; @@ -335,7 +338,7 @@

    Derivation processsurvey +smoothed using the svysmooth() function in the R survey package to estimate the weight and height SD scores for each day up to 7,305 days, with a bandwidth chosen to balance between over- and under-fitting, and interpolation between the estimates from this diff --git a/docs/articles/developer-guidelines.html b/docs/articles/developer-guidelines.html new file mode 100644 index 00000000..c6854bb4 --- /dev/null +++ b/docs/articles/developer-guidelines.html @@ -0,0 +1,189 @@ + + + + + + + +Developer guidelines • growthcleanr + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    CRAN Release Checklist +

    +

    When deploying updates to CRAN, here a few updates that you need to +check off before doing so:

    +
      +
    • Update version number in DESCRIPTION in format major.minor.patch +(e.g. 1.2.1)
    • +
    • Update package documentation with +devtools::document() +
    • +
    • Run devtools::check(): +
        +
      • If any problems come up that have not previously been documented in +cran-comments.md and cannot be fixed, fix them. There +should be no ERRORs or WARNINGs before submitting to CRAN.
      • +
      • Look through past CRAN submissions to make sure you haven’t +reintroduced a bug/note that has been addressed in a previous +version
      • +
      +
    • +
    • If you have made any changes to README.Rmd, re-knit to +README.md +
    • +
    • Update pkgdown site with pkgdown::build_site() +
    • +
    • Update NEWS.md with version updates
    • +
    • Update cran-comments.md in format
    • +
    • After the branch is merged, create a GitHub release
    • +
    • After the branch is merged, submit to CRAN with previously written +comments!
    • +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.6.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/articles/index.html b/docs/articles/index.html index 927b54f4..1ea1d778 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3 @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -111,13 +114,15 @@

    Advanced

    Next steps
    +
    Developer guidelines
    +
    diff --git a/docs/articles/installation.html b/docs/articles/installation.html index 21aa7aa7..d4afe748 100644 --- a/docs/articles/installation.html +++ b/docs/articles/installation.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -110,7 +113,7 @@ +

    To install the latest development version from GitHub using +devtools:

    -install.packages("remotes")
    -remotes::install_github("carriedaymont/growthcleanr", ref="main")
    -

    Note that ref="main" is required; the default branch is -“main”, and must be referred to explicitly.

    -

    growthcleanr itself has several dependencies, so it may -take a little while to download and install everything on your -machine.

    +devtools::install_github("carriedaymont/growthcleanr", ref="main") +

    Installing growthcleanr will install several additional +packages in turn.

    +

    See GitHub and source-level install for +developers for additional details.

    Optional packages

    @@ -247,21 +245,39 @@

    Docker

    -

    Source-level install for developers +

    +GitHub and source-level install for +developers

    -

    If you want to work with and potentially change the -growthcleanr code itself, you can download or clone the -growthcleanr source code and then install it from source. -To clone the source using git:

    -
    % git clone https://github.com/carriedaymont/growthcleanr.git
    -

    Either way, once you have the growthcleanr package -source, open an R session from the growthcleanr base -directory. Then install growthcleanr using the R devtools -package:

    +

    You can install the growthcleanr package directly from +GitHub using devtools in the R console with:

    +
    +install.packages("devtools")
    +devtools::install_github("carriedaymont/growthcleanr", ref="main")
    +

    growthcleanr itself has several dependencies, so it may +take a little while to download and install everything on your +machine.

    +

    Note that the ref="main" part is required; the default +value of ref refers to a branch name that is not used in +the growthcleanr repository, which instead uses a default +branch called “main”.

    +

    To install a different branch, for example if you want to test a +branch associated with a merge request, specify the branch name as the +value of ref.

    +

    If you are unable to install devtools, a similar +function is available in the remotes package:

    +install.packages("remotes")
    +remotes::install_github("carriedaymont/growthcleanr", ref="main")
    +

    If you are developing the growthcleanr code itself, you +can download or clone the growthcleanr source code and then +install it from source. To clone the source using git:

    +
    % git clone https://github.com/carriedaymont/growthcleanr.git
    +

    Once you have the growthcleanr package source, open an R +session from the growthcleanr base directory. Then install +growthcleanr using the R devtools package:

    +
     devtools::install(".")
    -

    You can also install the package from an installation file if one is -obtained.

    diff --git a/docs/articles/large-data-sets.html b/docs/articles/large-data-sets.html index af80168e..19a5bd0a 100644 --- a/docs/articles/large-data-sets.html +++ b/docs/articles/large-data-sets.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.3 @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -110,7 +113,7 @@ @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -110,7 +113,7 @@ @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -110,7 +113,7 @@ @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -110,7 +113,7 @@ +

    To install the latest development version from GitHub using +devtools:

    -install.packages("remotes")
    -remotes::install_github("carriedaymont/growthcleanr", ref="main")
    -

    Note that ref="main" is required whether you use -devtools or remotes. The default -growthcleanr code branch is “main”, and this must be -referred to explicitly.

    +devtools::install_github("carriedaymont/growthcleanr", ref="main") +

    Installing growthcleanr will install several additional +packages in turn.

    Further installation details and notes can be found under Installation.

    @@ -304,7 +299,7 @@

    ExampleFor a data.frame object source_data containing growth data:

    -library(growthcleanr)
    +library(growthcleanr)
     
     # prepare data as a data.table
     data <- as.data.table(source_data)
    diff --git a/docs/articles/usage.html b/docs/articles/usage.html
    index db7600aa..0876c26e 100644
    --- a/docs/articles/usage.html
    +++ b/docs/articles/usage.html
    @@ -33,7 +33,7 @@
           
           
             growthcleanr
    -        2.0.1
    +        2.0.3
           
         
    @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -110,7 +113,7 @@

    Basic operations using example synthetic data

    diff --git a/docs/articles/utilities.html b/docs/articles/utilities.html index 929fb967..8dc24e43 100644 --- a/docs/articles/utilities.html +++ b/docs/articles/utilities.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -79,6 +79,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • @@ -111,7 +114,7 @@

    Utilities for computing pediatric BMI percentiles, Z-scores, and related tools

    -

    2022-07-17

    +

    2022-11-02

    Source: vignettes/utilities.Rmd diff --git a/docs/authors.html b/docs/authors.html index a8926fb2..7c3e80f4 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3 @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -87,7 +90,7 @@

    Authors

    • -

      Daymont Carrie. Author. +

      Daymont Carrie. Contributor, maintainer.

    • @@ -107,7 +110,7 @@

      Authors

    • -

      De los Santos Hannah. Contributor, maintainer. +

      De los Santos Hannah. Contributor.

    • @@ -178,7 +181,7 @@

      Citation

      diff --git a/docs/index.html b/docs/index.html index 49268272..d4afb83c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,7 +12,7 @@ - - - - - - - -Answers for adjustcarryforward — acf_answers • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Answers for adjustcarryforward — acf_answers • growthcleanr - - + + - - -
      -
      -
    - - -
    +
    @@ -162,109 +95,107 @@

    Answers for adjustcarryforward

    for a given dataset, already run through cleangrowth.

    -
    acf_answers(
    -  subjid,
    -  param,
    -  agedays,
    -  sex,
    -  measurement,
    -  orig.exclude,
    -  sd.recenter = NA,
    -  ewma.exp = -1.5,
    -  ref.data.path = "",
    -  quietly = T
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    subjid

    Vector of unique identifiers for each subject in the database.

    param

    Vector identifying each measurement, may be 'WEIGHTKG', 'HEIGHTCM', or 'LENGTHCM' +

    +
    acf_answers(
    +  subjid,
    +  param,
    +  agedays,
    +  sex,
    +  measurement,
    +  orig.exclude,
    +  sd.recenter = NA,
    +  ewma.exp = -1.5,
    +  ref.data.path = "",
    +  quietly = TRUE
    +)
    +
    + +
    +

    Arguments

    +
    subjid
    +

    Vector of unique identifiers for each subject in the database.

    + + +
    param
    +

    Vector identifying each measurement, may be 'WEIGHTKG', 'HEIGHTCM', or 'LENGTHCM' 'HEIGHTCM' vs. 'LENGTHCM' only affects z-score calculations between ages 24 to 35 months (730 to 1095 days). All linear measurements below 731 days of life (age 0-23 months) are interpreted as supine length, and all linear measurements above 1095 days of life (age 36+ months) are interpreted as standing height. -Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference.

    agedays

    Numeric vector containing the age in days at each measurement.

    sex

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', -'f' or 1 for females.

    measurement

    Numeric vector containing the actual measurement data. Weight must be in -kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

    orig.exclude

    Vector of exclusion assessment results from cleangrowth()

    sd.recenter

    Data frame or table with median SD-scores per day of life

    ewma.exp

    Exponent to use for weighting measurements in the exponentially weighted moving +Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference.

    + + +
    agedays
    +

    Numeric vector containing the age in days at each measurement.

    + + +
    sex
    +

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', +'f' or 1 for females.

    + + +
    measurement
    +

    Numeric vector containing the actual measurement data. Weight must be in +kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

    + + +
    orig.exclude
    +

    Vector of exclusion assessment results from cleangrowth()

    + + +
    sd.recenter
    +

    Data frame or table with median SD-scores per day of life

    + + +
    ewma.exp
    +

    Exponent to use for weighting measurements in the exponentially weighted moving average calculations. Defaults to -1.5. This exponent should be negative in order to weight growth measurements closer to the measurement being evaluated more strongly. Exponents that are further from zero (e.g. -3) will increase the relative influence of measurements close in time to the measurement -being evaluated compared to using the default exponent.

    ref.data.path

    Path to reference data. If not supplied, the year 2000 -Centers for Disease Control (CDC) reference data will be used.

    quietly

    Determines if function messages are to be displayed and if log files (parallel only) -are to be generated. Defaults to TRUE.

    - -

    Value

    - -

    A data frame, containing an index "n" of rows, corresponding to the +being evaluated compared to using the default exponent.

    + + +
    ref.data.path
    +

    Path to reference data. If not supplied, the year 2000 +Centers for Disease Control (CDC) reference data will be used.

    + + +
    quietly
    +

    Determines if function messages are to be displayed and if log files (parallel only) +are to be generated. Defaults to TRUE.

    + +
    +
    +

    Value

    + + +

    A data frame, containing an index "n" of rows, corresponding to the original order of the input vectors, and "acf_answers", containing the answers on whether a height value should be kept or excluded (returns "Definitely Exclude", "Definitely Include", or "Unknown" for height values, NA for weight values).

    +
    + -
    - +
    - - + + diff --git a/docs/reference/adjustcarryforward.html b/docs/reference/adjustcarryforward.html index 80f36edd..861d7364 100644 --- a/docs/reference/adjustcarryforward.html +++ b/docs/reference/adjustcarryforward.html @@ -1,73 +1,18 @@ - - - - - - - -adjustcarryforward +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>adjustcarryforward adjustcarryforward Uses absolute height velocity to identify values -excluded as carried forward values for reinclusion. — adjustcarryforward • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - -
    -
    - -
    - -
    +
    @@ -170,66 +103,65 @@

    adjustcarryforward excluded as carried forward values for reinclusion.

    -
    adjustcarryforward(
    -  subjid,
    -  param,
    -  agedays,
    -  sex,
    -  measurement,
    -  orig.exclude,
    -  exclude_opt = 0,
    -  sd.recenter = NA,
    -  ewma.exp = -1.5,
    -  ref.data.path = "",
    -  quietly = T,
    -  minfactor = 0.5,
    -  maxfactor = 2,
    -  banddiff = 3,
    -  banddiff_plus = 5.5,
    -  min_ht.exp_under = 2,
    -  min_ht.exp_over = 0,
    -  max_ht.exp_under = 0.33,
    -  max_ht.exp_over = 1.5
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    subjid

    Vector of unique identifiers for each subject in the database.

    param

    Vector identifying each measurement, may be 'WEIGHTKG', 'HEIGHTCM', or 'LENGTHCM' +

    +
    adjustcarryforward(
    +  subjid,
    +  param,
    +  agedays,
    +  sex,
    +  measurement,
    +  orig.exclude,
    +  exclude_opt = 0,
    +  sd.recenter = NA,
    +  ewma.exp = -1.5,
    +  ref.data.path = "",
    +  quietly = TRUE,
    +  minfactor = 0.5,
    +  maxfactor = 2,
    +  banddiff = 3,
    +  banddiff_plus = 5.5,
    +  min_ht.exp_under = 2,
    +  min_ht.exp_over = 0,
    +  max_ht.exp_under = 0.33,
    +  max_ht.exp_over = 1.5
    +)
    +
    + +
    +

    Arguments

    +
    subjid
    +

    Vector of unique identifiers for each subject in the database.

    + + +
    param
    +

    Vector identifying each measurement, may be 'WEIGHTKG', 'HEIGHTCM', or 'LENGTHCM' 'HEIGHTCM' vs. 'LENGTHCM' only affects z-score calculations between ages 24 to 35 months (730 to 1095 days). All linear measurements below 731 days of life (age 0-23 months) are interpreted as supine length, and all linear measurements above 1095 days of life (age 36+ months) are interpreted as standing height. -Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference.

    agedays

    Numeric vector containing the age in days at each measurement.

    sex

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', -'f' or 1 for females.

    measurement

    Numeric vector containing the actual measurement data. Weight must be in -kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

    orig.exclude

    Vector of exclusion assessment results from cleangrowth()

    exclude_opt

    Number from 0 to 3 indicating which option to use to handle strings of carried-forwards: -0. no change.

      -
    1. when deciding to exclude values, if we have a string of carried forwards, +Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference.

      + + +
      agedays
      +

      Numeric vector containing the age in days at each measurement.

      + + +
      sex
      +

      Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', +'f' or 1 for females.

      + + +
      measurement
      +

      Numeric vector containing the actual measurement data. Weight must be in +kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

      + + +
      orig.exclude
      +

      Vector of exclusion assessment results from cleangrowth()

      + + +
      exclude_opt
      +

      Number from 0 to 3 indicating which option to use to handle strings of carried-forwards: +0. no change.

      1. when deciding to exclude values, if we have a string of carried forwards, drop the most deviant value, and all CFs in the same string, and move on as normal.

      2. when deciding to exclude values, if the most deviant in a @@ -242,112 +174,112 @@

        Arg string from 1:N. Exclude all after the first that is flagged for exclusion when comparing to the Include before and after. Make sure remove things designated as include.

      3. -
    sd.recenter

    Data frame or table with median SD-scores per day of life

    ewma.exp

    Exponent to use for weighting measurements in the exponentially weighted moving + + + +

    sd.recenter
    +

    Data frame or table with median SD-scores per day of life

    + + +
    ewma.exp
    +

    Exponent to use for weighting measurements in the exponentially weighted moving average calculations. Defaults to -1.5. This exponent should be negative in order to weight growth measurements closer to the measurement being evaluated more strongly. Exponents that are further from zero (e.g. -3) will increase the relative influence of measurements close in time to the measurement -being evaluated compared to using the default exponent.

    ref.data.path

    Path to reference data. If not supplied, the year 2000 -Centers for Disease Control (CDC) reference data will be used.

    quietly

    Determines if function messages are to be displayed and if log files (parallel only) -are to be generated. Defaults to TRUE.

    minfactor

    Sweep variable for computing mindiff.next.ht in 15f, default 0.5

    maxfactor

    Sweep variable for computing maxdiff.next.ht in 15f, default 2

    banddiff

    Sweep variable for computing mindiff.next.ht in 15f, default 3

    banddiff_plus

    Sweep variable for computing maxdiff.next.ht in 15, default 5.5

    min_ht.exp_under

    Sweep variable for computing ht.exp in 15f, default 2

    min_ht.exp_over

    Sweep variable for computing ht.exp in 15f, default 0

    max_ht.exp_under

    Sweep variable for computing ht.exp in 15f, default 0.33

    max_ht.exp_over

    Sweep variable for computing ht.exp in 15f, default 1.5

    - -

    Value

    - -

    Re-evaluated exclusion assessments based on height velocity.

    - -

    Examples

    -
    # Run on a small subset of given data -df <- as.data.frame(syngrowth) -df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ] -clean_df <- cbind(df, - "gcr_result" = cleangrowth(df$subjid, - df$param, - df$agedays, - df$sex, - df$measurement)) - -# Adjust carry forward values in cleaned data -adj_clean <- adjustcarryforward(subjid = clean_df$subjid, - param = clean_df$param, - agedays = clean_df$agedays, - sex = clean_df$sex, - measurement = clean_df$measurement, - orig.exclude = clean_df$gcr_result) -
    +being evaluated compared to using the default exponent.

    + + +
    ref.data.path
    +

    Path to reference data. If not supplied, the year 2000 +Centers for Disease Control (CDC) reference data will be used.

    + + +
    quietly
    +

    Determines if function messages are to be displayed and if log files (parallel only) +are to be generated. Defaults to TRUE.

    + + +
    minfactor
    +

    Sweep variable for computing mindiff.next.ht in 15f, default 0.5

    + + +
    maxfactor
    +

    Sweep variable for computing maxdiff.next.ht in 15f, default 2

    + + +
    banddiff
    +

    Sweep variable for computing mindiff.next.ht in 15f, default 3

    + + +
    banddiff_plus
    +

    Sweep variable for computing maxdiff.next.ht in 15, default 5.5

    + + +
    min_ht.exp_under
    +

    Sweep variable for computing ht.exp in 15f, default 2

    + + +
    min_ht.exp_over
    +

    Sweep variable for computing ht.exp in 15f, default 0

    + + +
    max_ht.exp_under
    +

    Sweep variable for computing ht.exp in 15f, default 0.33

    + + +
    max_ht.exp_over
    +

    Sweep variable for computing ht.exp in 15f, default 1.5

    + +
    +
    +

    Value

    + + +

    Re-evaluated exclusion assessments based on height velocity.

    +
    + +
    +

    Examples

    +
    # Run on a small subset of given data
    +df <- as.data.frame(syngrowth)
    +df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ]
    +clean_df <- cbind(df,
    +                  "gcr_result" = cleangrowth(df$subjid,
    +                                             df$param,
    +                                             df$agedays,
    +                                             df$sex,
    +                                             df$measurement))
    +
    +# Adjust carry forward values in cleaned data
    +adj_clean <- adjustcarryforward(subjid = clean_df$subjid,
    +                                param = clean_df$param,
    +                                agedays = clean_df$agedays,
    +                                sex = clean_df$sex,
    +                                measurement = clean_df$measurement,
    +                                orig.exclude = clean_df$gcr_result)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/bmianthro.html b/docs/reference/bmianthro.html index 0f712c26..82896db1 100644 --- a/docs/reference/bmianthro.html +++ b/docs/reference/bmianthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3 @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -111,7 +114,7 @@

    bmianthro.txt.gz

    diff --git a/docs/reference/cleangrowth.html b/docs/reference/cleangrowth.html index 47330833..27851c44 100644 --- a/docs/reference/cleangrowth.html +++ b/docs/reference/cleangrowth.html @@ -1,67 +1,12 @@ - - - - - - - -Clean growth measurements — cleangrowth • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Clean growth measurements — cleangrowth • growthcleanr - - - - + + -
    -
    - -
    - -
    +
    @@ -160,255 +93,256 @@

    Clean growth measurements

    Clean growth measurements

    -
    cleangrowth(
    -  subjid,
    -  param,
    -  agedays,
    -  sex,
    -  measurement,
    -  recover.unit.error = F,
    -  sd.extreme = 25,
    -  z.extreme = 25,
    -  lt3.exclude.mode = "default",
    -  height.tolerance.cm = 2.5,
    -  error.load.mincount = 2,
    -  error.load.threshold = 0.5,
    -  sd.recenter = NA,
    -  sdmedian.filename = "",
    -  sdrecentered.filename = "",
    -  include.carryforward = F,
    -  ewma.exp = -1.5,
    -  ref.data.path = "",
    -  log.path = ".",
    -  parallel = F,
    -  num.batches = NA,
    -  quietly = T,
    -  adult_cutpoint = 20,
    -  weight_cap = Inf,
    -  adult_columns_filename = ""
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    subjid

    Vector of unique identifiers for each subject in the database.

    param

    Vector identifying each measurement, may be 'WEIGHTKG', 'WEIGHTLBS', 'HEIGHTCM', 'HEIGHTIN', or 'LENGTHCM' +

    +
    cleangrowth(
    +  subjid,
    +  param,
    +  agedays,
    +  sex,
    +  measurement,
    +  recover.unit.error = FALSE,
    +  sd.extreme = 25,
    +  z.extreme = 25,
    +  lt3.exclude.mode = "default",
    +  height.tolerance.cm = 2.5,
    +  error.load.mincount = 2,
    +  error.load.threshold = 0.5,
    +  sd.recenter = NA,
    +  sdmedian.filename = "",
    +  sdrecentered.filename = "",
    +  include.carryforward = FALSE,
    +  ewma.exp = -1.5,
    +  ref.data.path = "",
    +  log.path = NA,
    +  parallel = FALSE,
    +  num.batches = NA,
    +  quietly = TRUE,
    +  adult_cutpoint = 20,
    +  weight_cap = Inf,
    +  adult_columns_filename = ""
    +)
    +
    + +
    +

    Arguments

    +
    subjid
    +

    Vector of unique identifiers for each subject in the database.

    + + +
    param
    +

    Vector identifying each measurement, may be 'WEIGHTKG', 'WEIGHTLBS', 'HEIGHTCM', 'HEIGHTIN', or 'LENGTHCM' 'HEIGHTCM'/'HEIGHTIN' vs. 'LENGTHCM' only affects z-score calculations between ages 24 to 35 months (730 to 1095 days). All linear measurements below 731 days of life (age 0-23 months) are interpreted as supine length, and all linear measurements above 1095 days of life (age 36+ months) are interpreted as standing height. Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference. Additionally, imperial 'HEIGHTIN' and 'WEIGHTLBS' measurements are converted to -metric during algorithm calculations.

    agedays

    Numeric vector containing the age in days at each measurement.

    sex

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', 'f' or 1 for females.

    measurement

    Numeric vector containing the actual measurement data. Weight must be in -kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

    recover.unit.error

    Indicates whether the cleaning algorithm should +metric during algorithm calculations.

    + + +
    agedays
    +

    Numeric vector containing the age in days at each measurement.

    + + +
    sex
    +

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', 'f' or 1 for females.

    + + +
    measurement
    +

    Numeric vector containing the actual measurement data. Weight must be in +kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

    + + +
    recover.unit.error
    +

    Indicates whether the cleaning algorithm should attempt to identify unit errors (I.e. inches vs. cm, lbs vs. kg). If unit errors are identified, the value will be corrected and retained within the -cleaning algorithm as a valid measurement. Defaults to FALSE.

    sd.extreme

    Measurements more than sd.extreme standard deviations from -the mean (either above or below) will be flagged as invalid. Defaults to 25.

    z.extreme

    Measurements with an absolute z-score greater than -z.extreme will be flagged as invalid. Defaults to 25.

    lt3.exclude.mode

    Determines type of exclusion procedure to use for 1 or 2 measurements of one type without +cleaning algorithm as a valid measurement. Defaults to FALSE.

    + + +
    sd.extreme
    +

    Measurements more than sd.extreme standard deviations from +the mean (either above or below) will be flagged as invalid. Defaults to 25.

    + + +
    z.extreme
    +

    Measurements with an absolute z-score greater than +z.extreme will be flagged as invalid. Defaults to 25.

    + + +
    lt3.exclude.mode
    +

    Determines type of exclusion procedure to use for 1 or 2 measurements of one type without matching same ageday measurements for the other parameter. Options include "default" (standard growthcleanr approach), and "flag.both" (in case of two measurements of one type without matching values for the other parameter, flag both -for exclusion if beyond threshold)

    height.tolerance.cm

    maximum decrease in height tolerated for sequential measurements

    error.load.mincount

    minimum count of exclusions on parameter before -considering excluding all measurements. Defaults to 2.

    error.load.threshold

    threshold of percentage of excluded measurement count to included measurement -count that must be exceeded before excluding all measurements of either parameter. Defaults to 0.5.

    sd.recenter

    specifies how to recenter medians. May be a data frame or +for exclusion if beyond threshold)

    + + +
    height.tolerance.cm
    +

    maximum decrease in height tolerated for sequential measurements

    + + +
    error.load.mincount
    +

    minimum count of exclusions on parameter before +considering excluding all measurements. Defaults to 2.

    + + +
    error.load.threshold
    +

    threshold of percentage of excluded measurement count to included measurement +count that must be exceeded before excluding all measurements of either parameter. Defaults to 0.5.

    + + +
    sd.recenter
    +

    specifies how to recenter medians. May be a data frame or table w/median SD-scores per day of life by gender and parameter, or "NHANES" -or "derive" as a character vector.

      -
    • If sd.recenter is specified as a data set, use the data set

    • +or "derive" as a character vector.

      • If sd.recenter is specified as a data set, use the data set

      • If sd.recenter is specified as "nhanes", use NHANES reference medians

      • If sd.recenter is specified as "derive", derive from input

      • -
      • If sd.recenter is not specified or NA:

          -
        • If the input set has at least 5,000 observations, derive medians from input

        • +
        • If sd.recenter is not specified or NA:

          • If the input set has at least 5,000 observations, derive medians from input

          • If the input set has fewer than 5,000 observations, use NHANES

        • -
        - -

        If specifying a data set, columns must include param, sex, agedays, and sd.median +

      If specifying a data set, columns must include param, sex, agedays, and sd.median (referred to elsewhere as "modified Z-score"), and those medians will be used for recentering. A summary of how the NHANES reference medians were derived is -available in README.md. Defaults to NA.

    sdmedian.filename

    Name of file to save sd.median data calculated on the input dataset to as CSV. +available in README.md. Defaults to NA.

    + + +
    sdmedian.filename
    +

    Name of file to save sd.median data calculated on the input dataset to as CSV. Defaults to "", for which this data will not be saved. Use for extracting medians for parallel processing -scenarios other than the built-in parallel option.

    sdrecentered.filename

    Name of file to save re-centered data to as CSV. Defaults to "", for which this -data will not be saved. Useful for post-processing and debugging.

    include.carryforward

    Determines whether Carry-Forward values are kept in the output. Defaults to False.

    ewma.exp

    Exponent to use for weighting measurements in the +scenarios other than the built-in parallel option.

    + + +
    sdrecentered.filename
    +

    Name of file to save re-centered data to as CSV. Defaults to "", for which this +data will not be saved. Useful for post-processing and debugging.

    + + +
    include.carryforward
    +

    Determines whether Carry-Forward values are kept in the output. Defaults to False.

    + + +
    ewma.exp
    +

    Exponent to use for weighting measurements in the exponentially weighted moving average calculations. Defaults to -1.5. This exponent should be negative in order to weight growth measurements closer to the measurement being evaluated more strongly. Exponents that are further from zero (e.g. -3) will increase the relative influence of measurements close in time to the measurement being evaluated compared to -using the default exponent.

    ref.data.path

    Path to reference data. If not supplied, the year 2000 -Centers for Disease Control (CDC) reference data will be used.

    log.path

    Path to log file output when running in parallel (non-quiet mode). Default is ".". A new -directory will be created if necessary. Set to NA to disable log files.

    parallel

    Determines if function runs in parallel. Defaults to FALSE.

    num.batches

    Specify the number of batches to run in parallel. Only +using the default exponent.

    + + +
    ref.data.path
    +

    Path to reference data. If not supplied, the year 2000 +Centers for Disease Control (CDC) reference data will be used.

    + + +
    log.path
    +

    Path to log file output when running in parallel (non-quiet mode). Default is NA. A new +directory will be created if necessary. Set to NA to disable log files.

    + + +
    parallel
    +

    Determines if function runs in parallel. Defaults to FALSE.

    + + +
    num.batches
    +

    Specify the number of batches to run in parallel. Only applies if parallel is set to TRUE. Defaults to the number of workers -returned by the getDoParWorkers function in the foreach package.

    quietly

    Determines if function messages are to be displayed and if log files (parallel only) are to be generated. -Defaults to TRUE

    adult_cutpoint

    Number between 18 and 20, describing ages when the +returned by the getDoParWorkers function in the foreach package.

    + + +
    quietly
    +

    Determines if function messages are to be displayed and if log files (parallel only) are to be generated. +Defaults to TRUE

    + + +
    adult_cutpoint
    +

    Number between 18 and 20, describing ages when the pediatric algorithm should not be applied (< adult_cutpoint), and the adult algorithm should apply (>= adult_cutpoint). Numbers outside this range will be -changed to the closest number within the range. Defaults to 20.

    weight_cap

    Positive number, describing a weight cap in kg (rounded to the +changed to the closest number within the range. Defaults to 20.

    + + +
    weight_cap
    +

    Positive number, describing a weight cap in kg (rounded to the nearest .1, +/- .1) within the adult dataset. If there is no weight cap, set -to Inf. Defaults to Inf.

    adult_columns_filename

    Name of file to save original adult data, with additional output columns to +to Inf. Defaults to Inf.

    + + +
    adult_columns_filename
    +

    Name of file to save original adult data, with additional output columns to as CSV. Defaults to "", for which this data will not be saved. Useful -for post-analysis. For more information on this output, please see README.

    +for post-analysis. For more information on this output, please see README.

    -

    Value

    +
    +
    +

    Value

    + -

    Vector of exclusion codes for each of the input measurements.

    -

    Possible values for each code are:

      -
    • 'Include', 'Unit-Error-High', 'Unit-Error-Low', 'Swapped-Measurements', 'Missing',

    • +

      Vector of exclusion codes for each of the input measurements.

      + + +

      Possible values for each code are:

      • 'Include', 'Unit-Error-High', 'Unit-Error-Low', 'Swapped-Measurements', 'Missing',

      • 'Exclude-Carried-Forward', 'Exclude-SD-Cutoff', 'Exclude-EWMA-Extreme', 'Exclude-EWMA-Extreme-Pair',

      • 'Exclude-Extraneous-Same-Day',

      • 'Exclude-EWMA-8', 'Exclude-EWMA-9', 'Exclude-EWMA-10', 'Exclude-EWMA-11', 'Exclude-EWMA-12', 'Exclude-EWMA-13', 'Exclude-EWMA-14',

      • 'Exclude-Min-Height-Change', 'Exclude-Max-Height-Change',

      • 'Exclude-Pair-Delta-17', 'Exclude-Pair-Delta-18', 'Exclude-Pair-Delta-19',

      • 'Exclude-Single-Outlier', 'Exclude-Too-Many-Errors', 'Exclude-Too-Many-Errors-Other-Parameter'

      • -
      - - -

      Examples

      -
      # Run calculation using a small subset of given data -df_stats <- as.data.frame(syngrowth) -df_stats <- df_stats[df_stats$subjid %in% unique(df_stats[, "subjid"])[1:5], ] - -clean_stats <-cleangrowth(subjid = df_stats$subjid, - param = df_stats$param, - agedays = df_stats$agedays, - sex = df_stats$sex, - measurement = df_stats$measurement) - -# Once processed you can filter data based on result value -df_stats <- cbind(df_stats, "clean_result" = clean_stats) -clean_df_stats <- df_stats[df_stats$clean_result == "Include",] - -# Parallel processing: run using 2 cores and batches -clean_stats <- cleangrowth(subjid = df_stats$subjid, - param = df_stats$param, - agedays = df_stats$agedays, - sex = df_stats$sex, - measurement = df_stats$measurement, - parallel = TRUE, - num.batches = 2) -
      #> [2021-07-06 10:53:04] Writing batch logs to '.'...
      #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
      #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
      #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
      #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
      +
    + +
    +

    Examples

    +
    # \donttest{
    +# Run calculation using a small subset of given data
    +df_stats <- as.data.frame(syngrowth)
    +df_stats <- df_stats[df_stats$subjid %in% unique(df_stats[, "subjid"])[1:5], ]
    +
    +clean_stats <-cleangrowth(subjid = df_stats$subjid,
    +                         param = df_stats$param,
    +                         agedays = df_stats$agedays,
    +                         sex = df_stats$sex,
    +                         measurement = df_stats$measurement)
    +
    +# Once processed you can filter data based on result value
    +df_stats <- cbind(df_stats, "clean_result" = clean_stats)
    +clean_df_stats <- df_stats[df_stats$clean_result == "Include",]
    +
    +# Parallel processing: run using 2 cores and batches
    +clean_stats <- cleangrowth(subjid = df_stats$subjid,
    +                           param = df_stats$param,
    +                           agedays = df_stats$agedays,
    +                           sex = df_stats$sex,
    +                           measurement = df_stats$measurement,
    +                           parallel = TRUE,
    +                           num.batches = 2)
    +#> Warning: <anonymous>: ... may be used in an incorrect context: '.fun(piece, ...)'
    +#> Warning: <anonymous>: ... may be used in an incorrect context: '.fun(piece, ...)'
    +#> Warning: <anonymous>: ... may be used in an incorrect context: '.fun(piece, ...)'
    +#> Warning: <anonymous>: ... may be used in an incorrect context: '.fun(piece, ...)'
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/ewma.html b/docs/reference/ewma.html index 7e4fa819..bae6a812 100644 --- a/docs/reference/ewma.html +++ b/docs/reference/ewma.html @@ -1,67 +1,12 @@ - - - - - - - -Exponentially Weighted Moving Average (EWMA) — ewma • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Exponentially Weighted Moving Average (EWMA) — ewma • growthcleanr - - - - + + -
    -
    - -
    - -
    +
    @@ -160,83 +93,80 @@

    Exponentially Weighted Moving Average (EWMA)

    ewma calculates the exponentially weighted moving average (EWMA) for a set of numeric observations over time.

    -
    ewma(agedays, z, ewma.exp, ewma.adjacent = T)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    agedays

    Vector of age in days for each z score (potentially transformed to adjust weighting).

    z

    Input vector of numeric z-score data.

    ewma.exp

    Exponent to use for weighting.

    ewma.adjacent

    Specify whether EWMA values excluding adjacent measurements should be calculated. Defaults to TRUE.

    - -

    Value

    - -

    Data frame with 3 variables:

      -
    • The first variable (ewma.all) contains the EWMA at observation time +

      +
      ewma(agedays, z, ewma.exp, ewma.adjacent = TRUE)
      +
      + +
      +

      Arguments

      +
      agedays
      +

      Vector of age in days for each z score (potentially transformed to adjust weighting).

      + + +
      z
      +

      Input vector of numeric z-score data.

      + + +
      ewma.exp
      +

      Exponent to use for weighting.

      + + +
      ewma.adjacent
      +

      Specify whether EWMA values excluding adjacent measurements should be calculated. Defaults to TRUE.

      + +
      +
      +

      Value

      + + +

      Data frame with 3 variables:

      • The first variable (ewma.all) contains the EWMA at observation time excluding only the actual observation for that time point.

      • The second variable (ewma.before) contains the EWMA for each observation excluding both the actual observation and the immediate prior observation.

      • The third variable (ewma.after) contains the EWMA for each observation excluding both the actual observation and the subsequent observation.

      • -
      - - -

      Examples

      -
      # Run on 1 subject, 1 type of parameter -df_stats <- as.data.frame(syngrowth) -df_stats <- df_stats[df_stats$subjid == df_stats$subjid[1] & - df_stats$param == "HEIGHTCM", ] - -# Get the uncentered z-scores -measurement_to_z <- read_anthro(cdc.only = TRUE) -sd <- measurement_to_z(df_stats$param, - df_stats$agedays, - df_stats$sex, - df_stats$measurement, - TRUE) - -# Calculate exponentially weighted moving average -e_df <- ewma(df_stats$agedays, sd, ewma.exp = -1.5) -
      +
    + +
    +

    Examples

    +
    # Run on 1 subject, 1 type of parameter
    +df_stats <- as.data.frame(syngrowth)
    +df_stats <- df_stats[df_stats$subjid == df_stats$subjid[1] &
    +                       df_stats$param == "HEIGHTCM", ]
    +
    +# Get the uncentered z-scores
    +measurement_to_z <- read_anthro(cdc.only = TRUE)
    +sd <- measurement_to_z(df_stats$param,
    +                       df_stats$agedays,
    +                       df_stats$sex,
    +                       df_stats$measurement,
    +                       TRUE)
    +
    +# Calculate exponentially weighted moving average
    +e_df <- ewma(df_stats$agedays, sd, ewma.exp = -1.5)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/ext_bmiz.html b/docs/reference/ext_bmiz.html index b4023ffc..43991e80 100644 --- a/docs/reference/ext_bmiz.html +++ b/docs/reference/ext_bmiz.html @@ -1,72 +1,17 @@ - - - - - - - -Calculate extended BMI measures — ext_bmiz • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Calculate extended BMI measures — ext_bmiz • growthcleanr - - - - - - - - - + + - - - - -
    -
    - -
    - -
    +
    @@ -170,55 +103,57 @@

    Calculate extended BMI measures

    differ only for children who have a BMI > 95th percentile.

    -
    ext_bmiz(
    -  data,
    -  age = "agem",
    -  wt = "wt",
    -  ht = "ht",
    -  bmi = "bmi",
    -  adjust.integer.age = T,
    -  ref.data.path = ""
    -)
    +
    +
    ext_bmiz(
    +  data,
    +  age = "agem",
    +  wt = "wt",
    +  ht = "ht",
    +  bmi = "bmi",
    +  adjust.integer.age = TRUE,
    +  ref.data.path = ""
    +)
    +
    + +
    +

    Arguments

    +
    data
    +

    Input data frame or data table

    + + +
    age
    +

    Name of input column containing subject age in months in quotes, default "agem"

    + + +
    wt
    +

    Name of input column containing weight (kg) value in quotes, default "wt"

    + + +
    ht
    +

    Name of input column containing height (cm) value in quotes, default "ht"

    -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    data

    Input data frame or data table

    age

    Name of input column containing subject age in months in quotes, default "agem"

    wt

    Name of input column containing weight (kg) value in quotes, default "wt"

    ht

    Name of input column containing height (cm) value in quotes, default "ht"

    bmi

    Name of input column containing calculated BMI in quotes, default "bmi"

    adjust.integer.age

    If age inputs are all integer, add 0.5 if TRUE; -default TRUE

    ref.data.path

    Path to directory containing reference data

    -

    Value

    +
    bmi
    +

    Name of input column containing calculated BMI in quotes, default "bmi"

    -

    Expanded data frame containing computed BMI values

    -

    Details

    +
    adjust.integer.age
    +

    If age inputs are all integer, add 0.5 if TRUE; +default TRUE

    + + +
    ref.data.path
    +

    Path to directory containing reference data

    + +
    +
    +

    Value

    + + +

    Expanded data frame containing computed BMI values

    +
    +
    +

    Details

    This function should produce output equivalent to the SAS macro provided at https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm

    The extended BMIz is the inverse cumulative distribution function (CDF) of @@ -249,58 +184,57 @@

    Details in this package for convenience. If you are developing this package, use ref.data.path to adjust the path to this file from your working directory if necessary.

    +

    -

    Examples

    -
    # Run on a small subset of given data -df <- as.data.frame(syngrowth) -df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ] -df <- cbind(df, - "gcr_result" = cleangrowth(df$subjid, - df$param, - df$agedays, - df$sex, - df$measurement)) -df_wide <- longwide(df) # convert to wide format for ext_bmiz -df_wide_bmi <- simple_bmi(df_wide) # compute simple BMI - -# Calling the function with default column names -df_bmiz <- ext_bmiz(df_wide_bmi) - -# Specifying different column names; note that quotes are used -dfc <- simple_bmi(df_wide) -colnames(dfc)[colnames(dfc) %in% c("agem", "wt", "ht")] <- - c("agemos", "weightkg", "heightcm") -df_bmiz <- ext_bmiz(dfc, age="agemos", wt="weightkg", ht="heightcm") - -# Disabling conversion of all-integer age in months to (age + 0.5) -dfc <- simple_bmi(df_wide) -df_bmiz <- ext_bmiz(dfc, adjust.integer.age=FALSE) -
    +
    +

    Examples

    +
    # Run on a small subset of given data
    +df <- as.data.frame(syngrowth)
    +df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ]
    +df <- cbind(df,
    +            "gcr_result" = cleangrowth(df$subjid,
    +                                       df$param,
    +                                       df$agedays,
    +                                       df$sex,
    +                                       df$measurement))
    +df_wide <- longwide(df) # convert to wide format for ext_bmiz
    +df_wide_bmi <- simple_bmi(df_wide) # compute simple BMI
    +
    +# Calling the function with default column names
    +df_bmiz <- ext_bmiz(df_wide_bmi)
    +
    +# Specifying different column names; note that quotes are used
    +dfc <- simple_bmi(df_wide)
    +colnames(dfc)[colnames(dfc) %in% c("agem", "wt", "ht")] <-
    +  c("agemos", "weightkg", "heightcm")
    +df_bmiz <- ext_bmiz(dfc, age="agemos", wt="weightkg", ht="heightcm")
    +
    +# Disabling conversion of all-integer age in months to (age + 0.5)
    +dfc <- simple_bmi(df_wide)
    +df_bmiz <- ext_bmiz(dfc, adjust.integer.age=FALSE)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/growth_cdc_ext.html b/docs/reference/growth_cdc_ext.html index 8f4dedeb..2a5fb3fe 100644 --- a/docs/reference/growth_cdc_ext.html +++ b/docs/reference/growth_cdc_ext.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3 @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -111,7 +114,7 @@

    growthfile_cdc_ext.csv.gz

    diff --git a/docs/reference/index.html b/docs/reference/index.html index 2fbb4f2e..951153b1 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -223,7 +226,7 @@

    Datasets @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -111,7 +114,7 @@

    lenanthro.txt.gz

    diff --git a/docs/reference/longwide.html b/docs/reference/longwide.html index 010e12ca..eafdcbff 100644 --- a/docs/reference/longwide.html +++ b/docs/reference/longwide.html @@ -1,67 +1,12 @@ - - - - - - - -Transform data in growthcleanr format into wide structure for BMI calculation — longwide • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Transform data in growthcleanr format into wide structure for BMI calculation — longwide • growthcleanr - - - - + + -
    -
    - -
    - -
    +
    @@ -160,112 +93,112 @@

    Transform data in growthcleanr format into wide structure for BMI calculatio

    longwide transforms data from long to wide format. Ideal for transforming output from growthcleanr::cleangrowth() into a format suitable for growthcleanr::ext_bmiz().

    -
    longwide(
    -  long_df,
    -  id = "id",
    -  subjid = "subjid",
    -  sex = "sex",
    -  agedays = "agedays",
    -  param = "param",
    -  measurement = "measurement",
    -  gcr_result = "gcr_result",
    -  include_all = FALSE,
    -  inclusion_types = c("Include")
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    long_df

    A data frame to be transformed. Expects columns: id, subjid, sex, agedays, param, measurement, and gcr_result.

    id

    name of observation ID column

    subjid

    name of subject ID column

    sex

    name of sex descriptor column

    agedays

    name of age (in days) descriptor column

    param

    name of parameter column to identify each type of measurement

    measurement

    name of measurement column containing the actual measurement data

    gcr_result

    name of column of results from growthcleanr::cleangrowth()

    include_all

    Determines whether the function keeps all exclusion codes. If TRUE, all exclusion types are kept and the inclusion_types argument is ignored. Defaults to FALSE.

    inclusion_types

    Vector indicating which exclusion codes from the cleaning algorithm should be included in the data, given that include_all is FALSE. For all options, see growthcleanr::cleangrowth(). Defaults to c("Include").

    - -

    Value

    - -

    Returns a data frame transformed from long to wide. Includes only values flagged with indicated inclusion types. Note that, for each subject, heights without corresponding weights for a given age (and vice versa) will be dropped.

    - -

    Examples

    -
    # Run on a small subset of given data -df <- as.data.frame(syngrowth) -df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ] -df <- cbind(df, - "gcr_result" = cleangrowth(df$subjid, - df$param, - df$agedays, - df$sex, - df$measurement)) -# Convert to wide format -wide_df <- longwide(df) - -# Include all inclusion types -wide_df <- longwide(df, include_all = TRUE) - -# Specify all inclusion codes -wide_df <- longwide(df, inclusion_types = c("Include", "Exclude-Carried-Forward")) -
    +
    +
    longwide(
    +  long_df,
    +  id = "id",
    +  subjid = "subjid",
    +  sex = "sex",
    +  agedays = "agedays",
    +  param = "param",
    +  measurement = "measurement",
    +  gcr_result = "gcr_result",
    +  include_all = FALSE,
    +  inclusion_types = c("Include")
    +)
    +
    + +
    +

    Arguments

    +
    long_df
    +

    A data frame to be transformed. Expects columns: id, subjid, sex, agedays, param, measurement, and gcr_result.

    + + +
    id
    +

    name of observation ID column

    + + +
    subjid
    +

    name of subject ID column

    + + +
    sex
    +

    name of sex descriptor column

    + + +
    agedays
    +

    name of age (in days) descriptor column

    + + +
    param
    +

    name of parameter column to identify each type of measurement

    + + +
    measurement
    +

    name of measurement column containing the actual measurement data

    + + +
    gcr_result
    +

    name of column of results from growthcleanr::cleangrowth()

    + + +
    include_all
    +

    Determines whether the function keeps all exclusion codes. If TRUE, all exclusion types are kept and the inclusion_types argument is ignored. Defaults to FALSE.

    + + +
    inclusion_types
    +

    Vector indicating which exclusion codes from the cleaning algorithm should be included in the data, given that include_all is FALSE. For all options, see growthcleanr::cleangrowth(). Defaults to c("Include").

    + +
    +
    +

    Value

    + + +

    Returns a data frame transformed from long to wide. Includes only values flagged with indicated inclusion types. Note that, for each subject, heights without corresponding weights for a given age (and vice versa) will be dropped.

    +
    + +
    +

    Examples

    +
    # Run on a small subset of given data
    +df <- as.data.frame(syngrowth)
    +df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ]
    +df <- cbind(df,
    +            "gcr_result" = cleangrowth(df$subjid,
    +                                       df$param,
    +                                       df$agedays,
    +                                       df$sex,
    +                                       df$measurement))
    +# Convert to wide format
    +wide_df <- longwide(df)
    +
    +# Include all inclusion types
    +wide_df <- longwide(df, include_all = TRUE)
    +
    +# Specify all inclusion codes
    +wide_df <- longwide(df, inclusion_types = c("Include", "Exclude-Carried-Forward"))
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/nhanes-reference-medians.html b/docs/reference/nhanes-reference-medians.html index b5d5d6ce..e646f3fb 100644 --- a/docs/reference/nhanes-reference-medians.html +++ b/docs/reference/nhanes-reference-medians.html @@ -18,7 +18,7 @@ growthcleanr - 2.0.1 + 2.0.3 @@ -60,6 +60,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -109,7 +112,7 @@

    nhanes-reference-medians.csv.gz

    diff --git a/docs/reference/read_anthro.html b/docs/reference/read_anthro.html index 3b79c135..5d761bc3 100644 --- a/docs/reference/read_anthro.html +++ b/docs/reference/read_anthro.html @@ -1,67 +1,12 @@ - - - - - - - -Function to calculate z-scores and csd-scores based on anthro tables. — read_anthro • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function to calculate z-scores and csd-scores based on anthro tables. — read_anthro • growthcleanr - - + + - - -
    -
    - -
    - -
    +
    @@ -160,58 +93,58 @@

    Function to calculate z-scores and csd-scores based on anthro tables.

    Function to calculate z-scores and csd-scores based on anthro tables.

    -
    read_anthro(path = "", cdc.only = F)
    - -

    Arguments

    - - - - - - - - - - -
    path

    Path to supplied reference anthro data. Defaults to package anthro tables.

    cdc.only

    Whether or not only CDC data should be used. Defaults to false.

    - -

    Value

    - -

    Function for calculating BMI based on measurement, age in days, sex, and measurement value.

    - -

    Examples

    -
    # Return calculating function with all defaults -afunc <- read_anthro() - -# Return calculating function while specifying a path and using only CDC data -afunc <- read_anthro(path = system.file("extdata", package = "growthcleanr"), - cdc.only = TRUE) -
    +
    +
    read_anthro(path = "", cdc.only = FALSE)
    +
    + +
    +

    Arguments

    +
    path
    +

    Path to supplied reference anthro data. Defaults to package anthro tables.

    + + +
    cdc.only
    +

    Whether or not only CDC data should be used. Defaults to false.

    + +
    +
    +

    Value

    + + +

    Function for calculating BMI based on measurement, age in days, sex, and measurement value.

    +
    + +
    +

    Examples

    +
    # Return calculating function with all defaults
    +afunc <- read_anthro()
    +
    +# Return calculating function while specifying a path and using only CDC data
    +afunc <- read_anthro(path = system.file("extdata", package = "growthcleanr"),
    +                     cdc.only = TRUE)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/recode_sex.html b/docs/reference/recode_sex.html index 2532cf5d..1f0d7988 100644 --- a/docs/reference/recode_sex.html +++ b/docs/reference/recode_sex.html @@ -1,68 +1,13 @@ - - - - - - - -Recode binary sex variable for compatibility — recode_sex • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Recode binary sex variable for compatibility — recode_sex • growthcleanr - + + - - - -
    -
    - -
    - -
    +
    @@ -162,91 +95,91 @@

    Recode binary sex variable for compatibility

    Useful in transforming output from growthcleanr::cleangrowth() into a format suitable for growthcleanr::ext_bmiz().

    -
    recode_sex(
    -  input_data,
    -  sourcecol = "sex",
    -  sourcem = "0",
    -  sourcef = "1",
    -  targetcol = "sex_recoded",
    -  targetm = 1L,
    -  targetf = 2L
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    input_data

    a data frame or data table to be transformed. Expects a source column containing a binary sex variable.

    sourcecol

    name of sex descriptor column. Defaults to "sex"

    sourcem

    variable indicating "male" sex in input data. Defaults to "0"

    sourcef

    variable indicating "female" sex in input data. Defaults to "1"

    targetcol

    desired name of recoded sex descriptor column. Defaults to "sex_recoded"

    targetm

    desired name of recoded sex variable indicating "male" sex in output data. Defaults to 1

    targetf

    desired name of recoded sex variable indicating "female" sex in output data. Defaults to 2

    - -

    Value

    - -

    Returns a data table with recoded sex variables.

    - -

    Examples

    -
    # Run on given data -df <- as.data.frame(syngrowth) - -# Run with all defaults -df_r <- recode_sex(df) - -# Specify different targets -df_rt <- recode_sex(df, targetcol = "sexr", targetm = "Male", targetf = "Female") - -# Specify different inputs -df_ri <- recode_sex(df_rt, sourcecol = "sexr", sourcem = "Male", sourcef = "Female") -
    +
    +
    recode_sex(
    +  input_data,
    +  sourcecol = "sex",
    +  sourcem = "0",
    +  sourcef = "1",
    +  targetcol = "sex_recoded",
    +  targetm = 1L,
    +  targetf = 2L
    +)
    +
    + +
    +

    Arguments

    +
    input_data
    +

    a data frame or data table to be transformed. Expects a source column containing a binary sex variable.

    + + +
    sourcecol
    +

    name of sex descriptor column. Defaults to "sex"

    + + +
    sourcem
    +

    variable indicating "male" sex in input data. Defaults to "0"

    + + +
    sourcef
    +

    variable indicating "female" sex in input data. Defaults to "1"

    + + +
    targetcol
    +

    desired name of recoded sex descriptor column. Defaults to "sex_recoded"

    + + +
    targetm
    +

    desired name of recoded sex variable indicating "male" sex in output data. Defaults to 1

    + + +
    targetf
    +

    desired name of recoded sex variable indicating "female" sex in output data. Defaults to 2

    + +
    +
    +

    Value

    + + +

    Returns a data table with recoded sex variables.

    +
    + +
    +

    Examples

    +
    # Run on given data
    +df <- as.data.frame(syngrowth)
    +
    +# Run with all defaults
    +df_r <- recode_sex(df)
    +
    +# Specify different targets
    +df_rt <- recode_sex(df, targetcol = "sexr", targetm = "Male", targetf = "Female")
    +
    +# Specify different inputs
    +df_ri <- recode_sex(df_rt, sourcecol = "sexr", sourcem = "Male", sourcef = "Female")
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/sd_median.html b/docs/reference/sd_median.html index ca7ea267..f3df27fb 100644 --- a/docs/reference/sd_median.html +++ b/docs/reference/sd_median.html @@ -1,67 +1,12 @@ - - - - - - - -Calculate median SD score by age for each parameter. — sd_median • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Calculate median SD score by age for each parameter. — sd_median • growthcleanr - - + + - - -
    -
    - -
    - -
    +
    @@ -160,77 +93,77 @@

    Calculate median SD score by age for each parameter.

    Calculate median SD score by age for each parameter.

    -
    sd_median(param, sex, agedays, sd.orig)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    param

    Vector identifying each measurement, may be 'WEIGHTKG', or 'HEIGHTCM'.

    sex

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', 'f' or 1 for females.

    agedays

    Numeric vector containing the age in days at each measurement.

    sd.orig

    Vector of previously calculated standard deviation (SD) scores for each measurement before re-centering.

    - -

    Value

    - -

    Table of data with median SD-scores per day of life by gender and parameter.

    - -

    Examples

    -
    # Run on 1 subject -df_stats <- as.data.frame(syngrowth) -df_stats <- df_stats[df_stats$subjid == df_stats$subjid[1], ] - -# Get the original standard deviations -measurement_to_z <- read_anthro(cdc.only = TRUE) -sd.orig <- measurement_to_z(df_stats$param, - df_stats$agedays, - df_stats$sex, - df_stats$measurement, - TRUE) - -# Calculate median standard deviations -sd.m <- sd_median(df_stats$param, - df_stats$sex, - df_stats$agedays, - sd.orig) -
    +
    +
    sd_median(param, sex, agedays, sd.orig)
    +
    + +
    +

    Arguments

    +
    param
    +

    Vector identifying each measurement, may be 'WEIGHTKG', or 'HEIGHTCM'.

    + + +
    sex
    +

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', 'f' or 1 for females.

    + + +
    agedays
    +

    Numeric vector containing the age in days at each measurement.

    + + +
    sd.orig
    +

    Vector of previously calculated standard deviation (SD) scores for each measurement before re-centering.

    + +
    +
    +

    Value

    + + +

    Table of data with median SD-scores per day of life by gender and parameter.

    +
    + +
    +

    Examples

    +
    # Run on 1 subject
    +df_stats <- as.data.frame(syngrowth)
    +df_stats <- df_stats[df_stats$subjid == df_stats$subjid[1], ]
    +
    +# Get the original standard deviations
    +measurement_to_z <- read_anthro(cdc.only = TRUE)
    +sd.orig <- measurement_to_z(df_stats$param,
    +                       df_stats$agedays,
    +                       df_stats$sex,
    +                       df_stats$measurement,
    +                       TRUE)
    +
    +# Calculate median standard deviations
    +sd.m <- sd_median(df_stats$param,
    +                  df_stats$sex,
    +                  df_stats$agedays,
    +                  sd.orig)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/simple_bmi.html b/docs/reference/simple_bmi.html index a34b715d..2d679b36 100644 --- a/docs/reference/simple_bmi.html +++ b/docs/reference/simple_bmi.html @@ -1,68 +1,13 @@ - - - - - - - -Compute BMI using standard formula — simple_bmi • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Compute BMI using standard formula — simple_bmi • growthcleanr - - - - + + -
    -
    - -
    - -
    +
    @@ -162,75 +95,75 @@

    Compute BMI using standard formula

    output from longwide().

    -
    simple_bmi(wide_df, wtcol = "wt", htcol = "ht")
    - -

    Arguments

    - - - - - - - - - - - - - - -
    wide_df

    A data frame or data table containing heights and weights in -wide format, e.g., after transformation with longwide()

    wtcol

    name of observation height value column, default 'wt'

    htcol

    name of subject weight value column, default 'ht'

    - -

    Value

    - -

    Returns a data table with the added column "bmi"

    - -

    Examples

    -
    # Simple usage -# Run on a small subset of given data -df <- as.data.frame(syngrowth) -df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ] -df <- cbind(df, - "gcr_result" = cleangrowth(df$subjid, - df$param, - df$agedays, - df$sex, - df$measurement)) -# Convert to wide format -wide_df <- longwide(df) -wide_df_with_bmi <- simple_bmi(wide_df) - -# Specifying different column names; note that quotes are used -colnames(wide_df)[colnames(wide_df) %in% c("wt", "ht")] <- - c("weight", "height") -wide_df_with_bmi <- simple_bmi(wide_df, wtcol = "weight", htcol = "height") -
    +
    +
    simple_bmi(wide_df, wtcol = "wt", htcol = "ht")
    +
    + +
    +

    Arguments

    +
    wide_df
    +

    A data frame or data table containing heights and weights in +wide format, e.g., after transformation with longwide()

    + + +
    wtcol
    +

    name of observation height value column, default 'wt'

    + + +
    htcol
    +

    name of subject weight value column, default 'ht'

    + +
    +
    +

    Value

    + + +

    Returns a data table with the added column "bmi"

    +
    + +
    +

    Examples

    +
    # Simple usage
    +# Run on a small subset of given data
    +df <- as.data.frame(syngrowth)
    +df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ]
    +df <- cbind(df,
    +            "gcr_result" = cleangrowth(df$subjid,
    +                                       df$param,
    +                                       df$agedays,
    +                                       df$sex,
    +                                       df$measurement))
    +# Convert to wide format
    +wide_df <- longwide(df)
    +wide_df_with_bmi <- simple_bmi(wide_df)
    +
    +# Specifying different column names; note that quotes are used
    +colnames(wide_df)[colnames(wide_df) %in% c("wt", "ht")] <-
    +  c("weight", "height")
    +wide_df_with_bmi <- simple_bmi(wide_df, wtcol = "weight", htcol = "height")
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/splitinput.html b/docs/reference/splitinput.html index e7851842..5995a54d 100644 --- a/docs/reference/splitinput.html +++ b/docs/reference/splitinput.html @@ -1,71 +1,16 @@ - - - - - - - -Split input data into multiple files — splitinput • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Split input data into multiple files — splitinput • growthcleanr - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -168,84 +101,87 @@

    Split input data into multiple files

    result.

    -
    splitinput(
    -  df,
    -  fname = deparse(substitute(df)),
    -  fdir = ".",
    -  min_nrow = 10000,
    -  keepcol = "subjid"
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    df

    data frame to split

    fname

    new name for each of the split files to start with

    fdir

    directory to put each of the split files (default working directory)

    min_nrow

    minimum number of rows for each split file (default 10000)

    keepcol

    the column name (default "subjid") to use to keep records with the same values together in the same single split file

    - -

    Value

    - -

    the count number referring to the last split file written

    - -

    Examples

    -
    if (FALSE) { -# Run on given data -df <- as.data.frame(syngrowth) - -# Run with all defaults -splitinput(df) - -# Specifying the name, directory and minimum row size -splitinput(df, fname = "syngrowth", fdir = tempdir(), min_nrow = 5000) - -# Specifying a different subject ID column -colnames(df)[colnames(df) == "subjid"] <- "sub_id" -splitinput(df, keepcol = "sub_id") -} -
    +
    +
    splitinput(
    +  df,
    +  fname = deparse(substitute(df)),
    +  fdir = NA,
    +  min_nrow = 10000,
    +  keepcol = "subjid"
    +)
    +
    + +
    +

    Arguments

    +
    df
    +

    data frame to split

    + + +
    fname
    +

    new name for each of the split files to start with

    + + +
    fdir
    +

    directory to put each of the split files (use "." for working directory). Must be changed from default (NA), which will trigger error.

    + + +
    min_nrow
    +

    minimum number of rows for each split file (default 10000)

    + + +
    keepcol
    +

    the column name (default "subjid") to use to keep records with the same values together in the same single split file

    + +
    +
    +

    Value

    + + +

    the count number referring to the last split file written

    +
    + +
    +

    Examples

    +
    # \donttest{
    +# Run on given data
    +df <- as.data.frame(syngrowth)
    +
    +# Run with all defaults (specifying directory)
    +splitinput(df, fdir = tempdir())
    +#> [1] 7
    +
    +# Specifying the name, directory and minimum row size
    +splitinput(df, fname = "syngrowth", fdir = tempdir(), min_nrow = 5000)
    +#> [1] 15
    +
    +# Specifying a different subject ID column
    +colnames(df)[colnames(df) == "subjid"] <- "sub_id"
    +splitinput(df, fdir = tempdir(), keepcol = "sub_id")
    +#> [1] 7
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/syngrowth.html b/docs/reference/syngrowth.html index 6f3fbcc9..cce32757 100644 --- a/docs/reference/syngrowth.html +++ b/docs/reference/syngrowth.html @@ -1,69 +1,14 @@ - - - - - - - -syngrowth — syngrowth • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -syngrowth — syngrowth • growthcleanr - - - - - - - - - + + - - - - -
    -
    - -
    - -
    +
    @@ -164,42 +97,41 @@

    syngrowth

    for testing with growthcleanr. Contains both pediatric and adult data.

    -
    syngrowth
    - - -

    Format

    +
    +
    syngrowth
    +
    +
    +

    Format

    A data frame with six variables: id, subjid, sex, agedays, param, and measurement

    -

    Details

    - +
    +
    +

    Details

    Example electronic health record (heightcm, weightkg) data.

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/tanner_ht_vel.html b/docs/reference/tanner_ht_vel.html index f56f3991..5b9f6a60 100644 --- a/docs/reference/tanner_ht_vel.html +++ b/docs/reference/tanner_ht_vel.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3 @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -111,7 +114,7 @@

    tanner_ht_vel.csv.gz

    diff --git a/docs/reference/tanner_ht_vel_with_2sd.html b/docs/reference/tanner_ht_vel_with_2sd.html index da34f2f7..b877e862 100644 --- a/docs/reference/tanner_ht_vel_with_2sd.html +++ b/docs/reference/tanner_ht_vel_with_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -112,7 +115,7 @@

    tanner_ht_vel_with_2sd.csv.gz

    diff --git a/docs/reference/test_syngrowth_sas_output_compare.html b/docs/reference/test_syngrowth_sas_output_compare.html index 814151fc..282acf6f 100644 --- a/docs/reference/test_syngrowth_sas_output_compare.html +++ b/docs/reference/test_syngrowth_sas_output_compare.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -107,7 +110,7 @@

    test_syngrowth_sas_output_compare.csv.gz

    diff --git a/docs/reference/test_syngrowth_wide.html b/docs/reference/test_syngrowth_wide.html index 7078c4f8..4b5b64a8 100644 --- a/docs/reference/test_syngrowth_wide.html +++ b/docs/reference/test_syngrowth_wide.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -107,7 +110,7 @@

    test_syngrowth_wide.csv.gz

    diff --git a/docs/reference/testacf.html b/docs/reference/testacf.html index 2410bd0e..c04da1cf 100644 --- a/docs/reference/testacf.html +++ b/docs/reference/testacf.html @@ -20,7 +20,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -62,6 +62,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -102,15 +105,15 @@

    Function to test adjust carried forward

    seed = 7, searchtype = "random", grid.length = 9, - writeout = F, + writeout = FALSE, outfile = paste0("test_adjustcarryforward_", format(Sys.time(), "%m-%d-%Y_%H-%M-%S")), - quietly = F, + quietly = FALSE, param = "none", - debug = F, + debug = FALSE, maxrecs = 0, exclude_opt = 0, - add_answers = T + add_answers = TRUE )
    @@ -183,7 +186,7 @@

    Value

    diff --git a/docs/reference/weianthro.html b/docs/reference/weianthro.html index 1e49922e..53b12195 100644 --- a/docs/reference/weianthro.html +++ b/docs/reference/weianthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -111,7 +114,7 @@

    weianthro.csv.gz

    diff --git a/docs/reference/who_ht_maxvel.html b/docs/reference/who_ht_maxvel.html index a7106e31..54f1907c 100644 --- a/docs/reference/who_ht_maxvel.html +++ b/docs/reference/who_ht_maxvel.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -112,7 +115,7 @@

    who_ht_maxvel_3sd.csv.gz

    diff --git a/docs/reference/who_ht_maxvel_2sd.html b/docs/reference/who_ht_maxvel_2sd.html index fb6b1695..82f0c988 100644 --- a/docs/reference/who_ht_maxvel_2sd.html +++ b/docs/reference/who_ht_maxvel_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -112,7 +115,7 @@

    who_ht_maxvel_2sd.csv.gz

    diff --git a/docs/reference/who_ht_vel_2sd.html b/docs/reference/who_ht_vel_2sd.html index f294bdd4..875885c8 100644 --- a/docs/reference/who_ht_vel_2sd.html +++ b/docs/reference/who_ht_vel_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -112,7 +115,7 @@

    who_ht_vel_2sd.csv.gz

    diff --git a/docs/reference/who_ht_vel_3sd.html b/docs/reference/who_ht_vel_3sd.html index 8fd6381c..4a4630f2 100644 --- a/docs/reference/who_ht_vel_3sd.html +++ b/docs/reference/who_ht_vel_3sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.3
    @@ -59,6 +59,9 @@
  • Next steps
  • +
  • + Developer guidelines +
  • Reference @@ -112,7 +115,7 @@

    who_ht_vel_3sd.csv.gz

    diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index f1e5dacf..2a60e114 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -84,27 +84,8 @@

    License

    -
    MIT License
    -
    -Copyright (c) 2018-2022 Carrie Daymont
    -
    -Permission is hereby granted, free of charge, to any person obtaining a copy
    -of this software and associated documentation files (the "Software"), to deal
    -in the Software without restriction, including without limitation the rights
    -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    -copies of the Software, and to permit persons to whom the Software is
    -furnished to do so, subject to the following conditions:
    -
    -The above copyright notice and this permission notice shall be included in all
    -copies or substantial portions of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    -SOFTWARE.
    +
    YEAR: 2022
    +COPYRIGHT HOLDER: Carrie Daymont
     
    @@ -122,7 +103,7 @@

    License

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/LICENSE.html b/docs/LICENSE.html new file mode 100644 index 00000000..f681cee1 --- /dev/null +++ b/docs/LICENSE.html @@ -0,0 +1,121 @@ + +MIT License • growthcleanr + + +
    +
    + + + +
    +
    + + +
    + +

    Copyright (c) 2022, Carrie Daymont

    +

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    +

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    +

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    +
    + +
    + + + +
    + + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/docs/articles/adult-algorithm.html b/docs/articles/adult-algorithm.html index 1f3cb5d1..a3210eb9 100644 --- a/docs/articles/adult-algorithm.html +++ b/docs/articles/adult-algorithm.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -110,7 +110,7 @@ @@ -110,7 +110,7 @@
  • error.load.mincount - default 2; @@ -335,7 +335,7 @@

    Derivation processsurvey +smoothed using the svysmooth() function in the R survey package to estimate the weight and height SD scores for each day up to 7,305 days, with a bandwidth chosen to balance between over- and under-fitting, and interpolation between the estimates from this @@ -360,12 +360,12 @@

    Derivation process

    -

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    +

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego, De los Santos Hannah.

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/index.html b/docs/articles/index.html index 927b54f4..6a8da397 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -121,7 +121,7 @@

    Advanced

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/installation.html b/docs/articles/installation.html index 21aa7aa7..82a71f84 100644 --- a/docs/articles/installation.html +++ b/docs/articles/installation.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -110,7 +110,7 @@ +

    To install the latest development version from GitHub using +devtools:

    -install.packages("remotes")
    -remotes::install_github("carriedaymont/growthcleanr", ref="main")
    -

    Note that ref="main" is required; the default branch is -“main”, and must be referred to explicitly.

    -

    growthcleanr itself has several dependencies, so it may -take a little while to download and install everything on your -machine.

    +devtools::install_github("carriedaymont/growthcleanr", ref="main") +

    Installing growthcleanr will install several additional +packages in turn.

    +

    See GitHub and source-level install for +developers for additional details.

    Optional packages

    @@ -186,8 +181,8 @@

    macOS threads. You will know it worked successfully if, when you load the data.table library in R, you see something like the following:

    -
    library(data.table)
    -data.table 1.12.2 using 2 threads (see ?getDTthreads).  Latest news: r-datatable.com
    +
    library(data.table)
    +data.table 1.12.2 using 2 threads (see ?getDTthreads).  Latest news: r-datatable.com

    That data.table reports “using 2 threads” indicates that installation has succeeded. If the message reports using only one thread, see the advice under the “OpenMP @@ -210,7 +205,7 @@

    Docker

    To install and run growthcleanr using Docker, open the PowerShell on Windows, or open the Terminal on macOS, and enter this docker command:

    -
    % docker run -it mitre/growthcleanr:latest R
    +
    % docker run -it mitre/growthcleanr:latest R

    The first time this command is run, it might take a few minutes to download and extract several necessary components, but this should be fully automated. If successful, you should see an R prompt, from which @@ -221,7 +216,7 @@

    Docker your own data. For example, if you are on Windows, and your data is in C:\Users\exampleuser\analysis, specify a mapping using the added -v step below:

    -
    % docker run -it -v C:\Users\exampleusers\analysis:/usr/src/app mitre/growthcleanr:latest R
    +
    % docker run -it -v C:\Users\exampleusers\analysis:/usr/src/app mitre/growthcleanr:latest R

    Note that the slashes in file paths reverse direction from the reference to the folder location on your Windows machine (before the colon) to the folder location on the Docker container (after the colon); @@ -234,7 +229,7 @@

    Docker

    If you are on macOS, and your data is in /Users/exampleuser/analysis, specify a folder mapping like this:

    -
    % docker run -it -v /Users/exampleuser/analysis:/usr/src/app mitre/growthcleanr:latest R
    +
    % docker run -it -v /Users/exampleuser/analysis:/usr/src/app mitre/growthcleanr:latest R

    If you mapped a folder, then inside the Docker environment’s R prompt, when you then issue a command like list.files(), you should see a list of the same files in the R session that you see in @@ -247,21 +242,39 @@

    Docker

    -

    Source-level install for developers +

    +GitHub and source-level install for +developers

    -

    If you want to work with and potentially change the -growthcleanr code itself, you can download or clone the -growthcleanr source code and then install it from source. -To clone the source using git:

    -
    % git clone https://github.com/carriedaymont/growthcleanr.git
    -

    Either way, once you have the growthcleanr package -source, open an R session from the growthcleanr base -directory. Then install growthcleanr using the R devtools -package:

    +

    You can install the growthcleanr package directly from +GitHub using devtools in the R console with:

    +
    +install.packages("devtools")
    +devtools::install_github("carriedaymont/growthcleanr", ref="main")
    +

    growthcleanr itself has several dependencies, so it may +take a little while to download and install everything on your +machine.

    +

    Note that the ref="main" part is required; the default +value of ref refers to a branch name that is not used in +the growthcleanr repository, which instead uses a default +branch called “main”.

    +

    To install a different branch, for example if you want to test a +branch associated with a merge request, specify the branch name as the +value of ref.

    +

    If you are unable to install devtools, a similar +function is available in the remotes package:

    +install.packages("remotes")
    +remotes::install_github("carriedaymont/growthcleanr", ref="main")
    +

    If you are developing the growthcleanr code itself, you +can download or clone the growthcleanr source code and then +install it from source. To clone the source using git:

    +
    % git clone https://github.com/carriedaymont/growthcleanr.git
    +

    Once you have the growthcleanr package source, open an R +session from the growthcleanr base directory. Then install +growthcleanr using the R devtools package:

    +
     devtools::install(".")
    -

    You can also install the package from an installation file if one is -obtained.

    @@ -277,12 +290,12 @@

    Source-level install for developers

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/large-data-sets.html b/docs/articles/large-data-sets.html index af80168e..e4e324d6 100644 --- a/docs/articles/large-data-sets.html +++ b/docs/articles/large-data-sets.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -110,7 +110,7 @@ +
    Rscript exec/gcdriver.R --numbatches 4 --adult_split 50 my-large-input.csv my-large-input-cleaned.csv
    • --numbatches 4 may be a good starting point for testing @@ -290,29 +290,29 @@

      Reference for gcdriver.R

      All available options for gcdriver.R are described below.

      -
      Rscript exec/gcdriver.R --help
      -usage: gcdriver.R [--] [--help] [--quietly] [--opts OPTS] [--sdrecenter
      -       SDRECENTER] [--adult_cutpoint ADULT_CUTPOINT] [--weightcap
      -       WEIGHTCAP] [--numbatches NUMBATCHES] [--adult_split ADULT_SPLIT]
      -       infile outfile
      -
      -CLI driver for growthcleanr
      -
      -positional arguments:
      -  infile                input file
      -  outfile               output file
      -
      -flags:
      -  -h, --help            show this help message and exit
      -  -q, --quietly         Disable verbose output
      -
      -optional arguments:
      -  -x, --opts            RDS file containing argument values
      -  -s, --sdrecenter      sd.recenter data file [default: ]
      -  -a, --adult_cutpoint  adult cutpoint [default: 20]
      -  -w, --weightcap       weight cap [default: Inf]
      -  -n, --numbatches      Number of batches [default: 1]
      -  --adult_split         Number of splits to run data on [default: Inf]
      +
      Rscript exec/gcdriver.R --help
      +usage: gcdriver.R [--] [--help] [--quietly] [--opts OPTS] [--sdrecenter
      +       SDRECENTER] [--adult_cutpoint ADULT_CUTPOINT] [--weightcap
      +       WEIGHTCAP] [--numbatches NUMBATCHES] [--adult_split ADULT_SPLIT]
      +       infile outfile
      +
      +CLI driver for growthcleanr
      +
      +positional arguments:
      +  infile                input file
      +  outfile               output file
      +
      +flags:
      +  -h, --help            show this help message and exit
      +  -q, --quietly         Disable verbose output
      +
      +optional arguments:
      +  -x, --opts            RDS file containing argument values
      +  -s, --sdrecenter      sd.recenter data file [default: ]
      +  -a, --adult_cutpoint  adult cutpoint [default: 20]
      +  -w, --weightcap       weight cap [default: Inf]
      +  -n, --numbatches      Number of batches [default: 1]
      +  --adult_split         Number of splits to run data on [default: Inf]
      @@ -328,12 +328,12 @@

      Reference for gcdriver.R

      -

      Site built with pkgdown 2.0.6.

      +

      Site built with pkgdown 2.0.7.

      diff --git a/docs/articles/next-steps.html b/docs/articles/next-steps.html index 32602841..c29c2b68 100644 --- a/docs/articles/next-steps.html +++ b/docs/articles/next-steps.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -110,7 +110,7 @@
      @@ -110,7 +110,7 @@ @@ -110,7 +110,7 @@ +

      To install the latest development version from GitHub using +devtools:

      -install.packages("remotes")
      -remotes::install_github("carriedaymont/growthcleanr", ref="main")
      -

      Note that ref="main" is required whether you use -devtools or remotes. The default -growthcleanr code branch is “main”, and this must be -referred to explicitly.

      +devtools::install_github("carriedaymont/growthcleanr", ref="main") +

      Installing growthcleanr will install several additional +packages in turn.

      Further installation details and notes can be found under Installation.

      @@ -304,7 +296,7 @@

      ExampleFor a data.frame object source_data containing growth data:

      -library(growthcleanr)
      +library(growthcleanr)
       
       # prepare data as a data.table
       data <- as.data.table(source_data)
      @@ -485,12 +477,12 @@ 

      Example

      -

      Site built with pkgdown 2.0.6.

      +

      Site built with pkgdown 2.0.7.

      diff --git a/docs/articles/usage.html b/docs/articles/usage.html index db7600aa..5a05685c 100644 --- a/docs/articles/usage.html +++ b/docs/articles/usage.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.2

      @@ -110,7 +110,7 @@

      Basic operations using example synthetic data

      @@ -149,45 +149,45 @@

      Basic operations using ex

      It can be used as in the following example. Note that processing the example data with cleangrowth() will likely take a few minutes to complete.

      -
      library(data.table)
      -library(dplyr)
      -
      -# Convert the `syngrowth` data frame to a `data.table`
      -data <- as.data.table(syngrowth)
      -
      -# `setkey()` creates an efficient sorting key on the `data.table`; this is required
      -# for `cleangrowth()`
      -setkey(data, subjid, param, agedays)
      -
      -# Add a column `gcr_result` using `cleangrowth`
      -cleaned_data <- data[, gcr_result := cleangrowth(subjid, param, agedays, sex, measurement)]
      -
      -# View a sample of the results
      -head(cleaned_data)
      -      id                               subjid sex  agedays    param measurement                  gcr_result
      -1: 83330 002986c5-354d-bb9d-c180-4ce26813ca28   1 20489.22 HEIGHTCM       151.1                     Include
      -2: 83332 002986c5-354d-bb9d-c180-4ce26813ca28   1 20860.22 HEIGHTCM       151.1                     Include
      -3: 83334 002986c5-354d-bb9d-c180-4ce26813ca28   1 20860.22 HEIGHTCM       150.6 Exclude-Same-Day-Extraneous
      -4: 83335 002986c5-354d-bb9d-c180-4ce26813ca28   1 21231.22 HEIGHTCM       151.1                     Include
      -5: 83337 002986c5-354d-bb9d-c180-4ce26813ca28   1 21602.22 HEIGHTCM       151.1                     Include
      -6: 83339 002986c5-354d-bb9d-c180-4ce26813ca28   1 21623.22 HEIGHTCM       151.1                     Include
      -
      -# Summarize results by result type
      -cleaned_data %>% group_by(gcr_result) %>% tally(sort=TRUE)
      -# A tibble: 26 x 2
      -   gcr_result                      n
      -   <fct>                       <int>
      - 1 Include                     61652
      - 2 Exclude-Extraneous-Same-Day 11263
      - 3 Exclude-Carried-Forward      7093
      - 4 Exclude-Same-Day-Extraneous  4010
      - 5 Exclude-Same-Day-Identical    623
      - 6 Exclude-SD-Cutoff             175
      - 7 Exclude-EWMA-8                139
      - 8 Exclude-Distinct-3-Or-More    125
      - 9 Exclude-BIV                   108
      -10 Exclude-EWMA-Extreme           99
      -# … with 16 more rows
      +
      library(data.table)
      +library(dplyr)
      +
      +# Convert the `syngrowth` data frame to a `data.table`
      +data <- as.data.table(syngrowth)
      +
      +# `setkey()` creates an efficient sorting key on the `data.table`; this is required
      +# for `cleangrowth()`
      +setkey(data, subjid, param, agedays)
      +
      +# Add a column `gcr_result` using `cleangrowth`
      +cleaned_data <- data[, gcr_result := cleangrowth(subjid, param, agedays, sex, measurement)]
      +
      +# View a sample of the results
      +head(cleaned_data)
      +      id                               subjid sex  agedays    param measurement                  gcr_result
      +1: 83330 002986c5-354d-bb9d-c180-4ce26813ca28   1 20489.22 HEIGHTCM       151.1                     Include
      +2: 83332 002986c5-354d-bb9d-c180-4ce26813ca28   1 20860.22 HEIGHTCM       151.1                     Include
      +3: 83334 002986c5-354d-bb9d-c180-4ce26813ca28   1 20860.22 HEIGHTCM       150.6 Exclude-Same-Day-Extraneous
      +4: 83335 002986c5-354d-bb9d-c180-4ce26813ca28   1 21231.22 HEIGHTCM       151.1                     Include
      +5: 83337 002986c5-354d-bb9d-c180-4ce26813ca28   1 21602.22 HEIGHTCM       151.1                     Include
      +6: 83339 002986c5-354d-bb9d-c180-4ce26813ca28   1 21623.22 HEIGHTCM       151.1                     Include
      +
      +# Summarize results by result type
      +cleaned_data %>% group_by(gcr_result) %>% tally(sort=TRUE)
      +# A tibble: 26 x 2
      +   gcr_result                      n
      +   <fct>                       <int>
      + 1 Include                     61652
      + 2 Exclude-Extraneous-Same-Day 11263
      + 3 Exclude-Carried-Forward      7093
      + 4 Exclude-Same-Day-Extraneous  4010
      + 5 Exclude-Same-Day-Identical    623
      + 6 Exclude-SD-Cutoff             175
      + 7 Exclude-EWMA-8                139
      + 8 Exclude-Distinct-3-Or-More    125
      + 9 Exclude-BIV                   108
      +10 Exclude-EWMA-Extreme           99
      +# … with 16 more rows

      If you are able to run these steps and see a similar result, you have the growthcleanr package installed correctly. The resulting cleaned_data can be reviewed, subsetted, and compared in @@ -254,9 +254,9 @@

      Basic configuration options
      Warning messages:
      -1: <anonymous>: ... may be used in an incorrect context:.fun(piece, ...)’
      -2: <anonymous>: ... may be used in an incorrect context:.fun(piece, ...)’

      +
      Warning messages:
      +1: <anonymous>: ... may be used in an incorrect context:.fun(piece, ...)’
      +2: <anonymous>: ... may be used in an incorrect context:.fun(piece, ...)’

      This set of warnings is coming from one of growthcleanr’s dependencies, and does not indicate either failure or improper execution.

      @@ -298,12 +298,12 @@

      Basic configuration options

      -

      Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

      +

      Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego, De los Santos Hannah.

      -

      Site built with pkgdown 2.0.6.

      +

      Site built with pkgdown 2.0.7.

      diff --git a/docs/articles/utilities.html b/docs/articles/utilities.html index 929fb967..264db5e8 100644 --- a/docs/articles/utilities.html +++ b/docs/articles/utilities.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -111,7 +111,7 @@

      Utilities for computing pediatric BMI percentiles, Z-scores, and related tools

      -

      2022-07-17

      +

      2023-02-01

      Source: vignettes/utilities.Rmd @@ -141,6 +141,9 @@

      2022-07-17

      a BMI > 39, and it is likely that these BMIs represent data entry errors. For these cases, extended BMIz is set to 8.21, a value that is slightly greater than the largest value that can be calculated.

      +

      The CDC SAS macro was updated in December 2022, and +ext_bmiz() has been updated to match it as of growthcleanr +v2.1.0.

      Converting long growthcleanr data to wide format w/BMI

      @@ -173,27 +176,27 @@

      Converting long g

      Note that this assumes that cleaned_data has the same structure as described in Quickstart - Data preparation:

      -
      names(cleaned_data)
      -[1] "id"          "subjid"      "sex"         "agedays"     "param"       "measurement" "gcr_result"
      +
      names(cleaned_data)
      +[1] "id"          "subjid"      "sex"         "agedays"     "param"       "measurement" "gcr_result"

      The wide dataset cleaned_data_wide will include rows with aligned height and weight measurements drawn from the observations in cleaned_data marked by cleangrowth() for inclusion. As such, it will be a shorter dataset (fewer rows) based on fewer observations.

      -
      dim(cleaned_data)
      -[1] 85728     7
      -
      -dim(cleaned_data_wide)
      -[1] 26701     9
      -
      -head(cleaned_data_wide)
      -                                subjid    agey     agem sex   wt wt_id    ht ht_id  agedays
      -1 002986c5-354d-bb9d-c180-4ce26813ca28 56.0964 673.1568   2 71.7 83331 151.1 83330 20489.22
      -2 002986c5-354d-bb9d-c180-4ce26813ca28 57.1122 685.3464   2 73.2 83333 151.1 83332 20860.22
      -3 002986c5-354d-bb9d-c180-4ce26813ca28 58.1279 697.5348   2 74.6 83336 151.1 83335 21231.22
      -4 002986c5-354d-bb9d-c180-4ce26813ca28 59.1437 709.7244   2 72.8 83338 151.1 83337 21602.22
      -5 002986c5-354d-bb9d-c180-4ce26813ca28 59.2012 710.4144   2 72.4 83340 151.1 83339 21623.22
      -6 002986c5-354d-bb9d-c180-4ce26813ca28 60.1594 721.9128   2 69.4 83343 151.1 83342 21973.22
      +
      dim(cleaned_data)
      +[1] 85728     7
      +
      +dim(cleaned_data_wide)
      +[1] 26701     9
      +
      +head(cleaned_data_wide)
      +                                subjid    agey     agem sex   wt wt_id    ht ht_id  agedays
      +1 002986c5-354d-bb9d-c180-4ce26813ca28 56.0964 673.1568   2 71.7 83331 151.1 83330 20489.22
      +2 002986c5-354d-bb9d-c180-4ce26813ca28 57.1122 685.3464   2 73.2 83333 151.1 83332 20860.22
      +3 002986c5-354d-bb9d-c180-4ce26813ca28 58.1279 697.5348   2 74.6 83336 151.1 83335 21231.22
      +4 002986c5-354d-bb9d-c180-4ce26813ca28 59.1437 709.7244   2 72.8 83338 151.1 83337 21602.22
      +5 002986c5-354d-bb9d-c180-4ce26813ca28 59.2012 710.4144   2 72.4 83340 151.1 83339 21623.22
      +6 002986c5-354d-bb9d-c180-4ce26813ca28 60.1594 721.9128   2 69.4 83343 151.1 83342 21973.22

      In this example, the subject identifiers previously marked as subjid are now in the id column; individual identifiers for observations of a single parameter are not present.

      @@ -201,15 +204,15 @@

      Converting long g your input set uses different column names. For example, if my_cleaned_data specifies age in days as aged and parameter type as type, specify each, with quotes:

      -
      head(my_cleaned_data)
      -     id subjid sex    aged     type measurement                  gcr_result
      -1: 1510 775155   0     889 HEIGHTCM       84.90 Exclude-Extraneous-Same-Day
      -2: 1511 775155   0     889 HEIGHTCM       89.06                     Include
      -3: 1518 775155   0     889 WEIGHTKG       13.10                     Include
      -4: 1512 775155   0    1071 HEIGHTCM       92.50                     Include
      -5: 1519 775155   0    1071 WEIGHTKG       14.70                     Include
      -6: 1513 775155   0    1253 HEIGHTCM       96.20                     Include
      -longwide(my_cleaned_data, agedays = "aged", param = "type")
      +
      head(my_cleaned_data)
      +     id subjid sex    aged     type measurement                  gcr_result
      +1: 1510 775155   0     889 HEIGHTCM       84.90 Exclude-Extraneous-Same-Day
      +2: 1511 775155   0     889 HEIGHTCM       89.06                     Include
      +3: 1518 775155   0     889 WEIGHTKG       13.10                     Include
      +4: 1512 775155   0    1071 HEIGHTCM       92.50                     Include
      +5: 1519 775155   0    1071 WEIGHTKG       14.70                     Include
      +6: 1513 775155   0    1253 HEIGHTCM       96.20                     Include
      +longwide(my_cleaned_data, agedays = "aged", param = "type")

      By default, longwide() will only transform records flagged by cleangrowth() for inclusion. To include more categories assigned by cleangrowth(), use the @@ -266,22 +269,22 @@

      Computing BMI percentiles and Z-

      With data in wide format with BMI, and with sex variables properly coded, ext_bmiz() can be called:

      -
      cleaned_data_bmiz <- ext_bmiz(cleaned_data_bmi)
      -head(cleaned_data_bmiz)
      -           id    agey     agem      bmi sex   wt     ht agedays      age     bmi_l    bmi_m      bmi_s         waz    mod_waz        haz    mod_haz     bmiz  mod_bmiz
      -1: 1000287994 10.0301 120.3612 22.84087   1 40.1 132.50    3661 120.3612 -2.767881 16.64016 0.12002409  1.09852664  0.8417277 -0.9597118 -0.9717678 1.757419 1.5409867
      -2: 1000287994 11.0466 132.5592 22.84087   1 40.1 132.50    4032 132.5592 -2.589785 17.20379 0.12676206  0.52509455  0.3595874 -1.6331550 -1.6408514 1.584028 1.2827508
      -3: 1000287994 12.0630 144.7560 18.35674   1 40.1 147.80    4403 144.7560 -2.444694 17.82828 0.13146572 -0.08603109 -0.1155501 -0.2209003 -0.2267003 0.214444 0.1132188
      -4: 1000287994 13.0795 156.9540 24.12048   1 57.8 154.80    4774 156.9540 -2.325379 18.49734 0.13420981  1.07298540  0.8792766 -0.2418916 -0.2436118 1.475755 1.1619424
      -5: 1000287994 14.0959 169.1508 25.03608   1 66.6 163.10    5145 169.1508 -2.222102 19.19533 0.13527053  1.24466369  1.0724802 -0.1772860 -0.1713432 1.483245 1.1877586
      -6: 1000287994  4.9479  59.3748 16.88341   1 19.5 107.47    1806  59.3748 -2.533423 15.43155 0.07546578  0.48691152  0.3858433 -0.2363398 -0.2340109 1.065532 0.8981828
      -       bmip      p95      p97    bmip95       wp       hp obese sev_obese ext_bmiz ext_bmip    sigma
      -1: 96.05768 22.14172 23.71268 103.15762 86.40127 16.86001     1         0 1.705525 95.59517 4.668954
      -2: 94.34063 23.21872 24.93200  98.37264 70.02413  5.12182     0         0 1.584028 94.34063 5.002164
      -3: 58.48996 24.25081 26.05464  75.69536 46.57209 41.25850     0         0 0.214444 58.48996 5.316539
      -4: 92.99952 25.21239 27.05537  95.66916 85.83612 40.44321     0         0 1.475755 92.99952 5.612141
      -5: 93.09953 26.09135 27.92776  95.95547 89.33723 42.96419     0         0 1.483245 93.09953 5.888911
      -6: 85.66823 17.91161 18.39937  94.25957 68.68395 40.65845     0         0 1.065532 85.66823 2.720945
      +
      cleaned_data_bmiz <- ext_bmiz(cleaned_data_bmi)
      +head(cleaned_data_bmiz)
      +           id    agey     agem      bmi sex   wt     ht agedays      age     bmi_l    bmi_m      bmi_s         waz    mod_waz        haz    mod_haz     bmiz  mod_bmiz
      +1: 1000287994 10.0301 120.3612 22.84087   1 40.1 132.50    3661 120.3612 -2.767881 16.64016 0.12002409  1.09852664  0.8417277 -0.9597118 -0.9717678 1.757419 1.5409867
      +2: 1000287994 11.0466 132.5592 22.84087   1 40.1 132.50    4032 132.5592 -2.589785 17.20379 0.12676206  0.52509455  0.3595874 -1.6331550 -1.6408514 1.584028 1.2827508
      +3: 1000287994 12.0630 144.7560 18.35674   1 40.1 147.80    4403 144.7560 -2.444694 17.82828 0.13146572 -0.08603109 -0.1155501 -0.2209003 -0.2267003 0.214444 0.1132188
      +4: 1000287994 13.0795 156.9540 24.12048   1 57.8 154.80    4774 156.9540 -2.325379 18.49734 0.13420981  1.07298540  0.8792766 -0.2418916 -0.2436118 1.475755 1.1619424
      +5: 1000287994 14.0959 169.1508 25.03608   1 66.6 163.10    5145 169.1508 -2.222102 19.19533 0.13527053  1.24466369  1.0724802 -0.1772860 -0.1713432 1.483245 1.1877586
      +6: 1000287994  4.9479  59.3748 16.88341   1 19.5 107.47    1806  59.3748 -2.533423 15.43155 0.07546578  0.48691152  0.3858433 -0.2363398 -0.2340109 1.065532 0.8981828
      +       bmip      p95      p97    bmip95       wp       hp obese sev_obese ext_bmiz ext_bmip    sigma
      +1: 96.05768 22.14172 23.71268 103.15762 86.40127 16.86001     1         0 1.705525 95.59517 4.668954
      +2: 94.34063 23.21872 24.93200  98.37264 70.02413  5.12182     0         0 1.584028 94.34063 5.002164
      +3: 58.48996 24.25081 26.05464  75.69536 46.57209 41.25850     0         0 0.214444 58.48996 5.316539
      +4: 92.99952 25.21239 27.05537  95.66916 85.83612 40.44321     0         0 1.475755 92.99952 5.612141
      +5: 93.09953 26.09135 27.92776  95.95547 89.33723 42.96419     0         0 1.483245 93.09953 5.888911
      +6: 85.66823 17.91161 18.39937  94.25957 68.68395 40.65845     0         0 1.065532 85.66823 2.720945

      The output columns include:

      @@ -386,12 +389,12 @@

      Citation

      -

      Site built with pkgdown 2.0.6.

      +

      Site built with pkgdown 2.0.7.

      diff --git a/docs/index.html b/docs/index.html index 49268272..06152f02 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,7 +12,7 @@ - - - - - - - -Answers for adjustcarryforward — acf_answers • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Answers for adjustcarryforward — acf_answers • growthcleanr - - + + - - -
      -
      - -
      - -
      +
      @@ -162,109 +92,107 @@

      Answers for adjustcarryforward

      for a given dataset, already run through cleangrowth.

      -
      acf_answers(
      -  subjid,
      -  param,
      -  agedays,
      -  sex,
      -  measurement,
      -  orig.exclude,
      -  sd.recenter = NA,
      -  ewma.exp = -1.5,
      -  ref.data.path = "",
      -  quietly = T
      -)
      - -

      Arguments

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      subjid

      Vector of unique identifiers for each subject in the database.

      param

      Vector identifying each measurement, may be 'WEIGHTKG', 'HEIGHTCM', or 'LENGTHCM' +

      +
      acf_answers(
      +  subjid,
      +  param,
      +  agedays,
      +  sex,
      +  measurement,
      +  orig.exclude,
      +  sd.recenter = NA,
      +  ewma.exp = -1.5,
      +  ref.data.path = "",
      +  quietly = TRUE
      +)
      +
      + +
      +

      Arguments

      +
      subjid
      +

      Vector of unique identifiers for each subject in the database.

      + + +
      param
      +

      Vector identifying each measurement, may be 'WEIGHTKG', 'HEIGHTCM', or 'LENGTHCM' 'HEIGHTCM' vs. 'LENGTHCM' only affects z-score calculations between ages 24 to 35 months (730 to 1095 days). All linear measurements below 731 days of life (age 0-23 months) are interpreted as supine length, and all linear measurements above 1095 days of life (age 36+ months) are interpreted as standing height. -Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference.

      agedays

      Numeric vector containing the age in days at each measurement.

      sex

      Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', -'f' or 1 for females.

      measurement

      Numeric vector containing the actual measurement data. Weight must be in -kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

      orig.exclude

      Vector of exclusion assessment results from cleangrowth()

      sd.recenter

      Data frame or table with median SD-scores per day of life

      ewma.exp

      Exponent to use for weighting measurements in the exponentially weighted moving +Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference.

      + + +
      agedays
      +

      Numeric vector containing the age in days at each measurement.

      + + +
      sex
      +

      Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', +'f' or 1 for females.

      + + +
      measurement
      +

      Numeric vector containing the actual measurement data. Weight must be in +kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

      + + +
      orig.exclude
      +

      Vector of exclusion assessment results from cleangrowth()

      + + +
      sd.recenter
      +

      Data frame or table with median SD-scores per day of life

      + + +
      ewma.exp
      +

      Exponent to use for weighting measurements in the exponentially weighted moving average calculations. Defaults to -1.5. This exponent should be negative in order to weight growth measurements closer to the measurement being evaluated more strongly. Exponents that are further from zero (e.g. -3) will increase the relative influence of measurements close in time to the measurement -being evaluated compared to using the default exponent.

      ref.data.path

      Path to reference data. If not supplied, the year 2000 -Centers for Disease Control (CDC) reference data will be used.

      quietly

      Determines if function messages are to be displayed and if log files (parallel only) -are to be generated. Defaults to TRUE.

      - -

      Value

      - -

      A data frame, containing an index "n" of rows, corresponding to the +being evaluated compared to using the default exponent.

      + + +
      ref.data.path
      +

      Path to reference data. If not supplied, the year 2000 +Centers for Disease Control (CDC) reference data will be used.

      + + +
      quietly
      +

      Determines if function messages are to be displayed and if log files (parallel only) +are to be generated. Defaults to TRUE.

      + +
      +
      +

      Value

      + + +

      A data frame, containing an index "n" of rows, corresponding to the original order of the input vectors, and "acf_answers", containing the answers on whether a height value should be kept or excluded (returns "Definitely Exclude", "Definitely Include", or "Unknown" for height values, NA for weight values).

      +
      + -
      - +
      - - + + diff --git a/docs/reference/adjustcarryforward.html b/docs/reference/adjustcarryforward.html index 80f36edd..1582e750 100644 --- a/docs/reference/adjustcarryforward.html +++ b/docs/reference/adjustcarryforward.html @@ -1,73 +1,18 @@ - - - - - - - -adjustcarryforward +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>adjustcarryforward adjustcarryforward Uses absolute height velocity to identify values -excluded as carried forward values for reinclusion. — adjustcarryforward • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - -
      -
      -

    - - -
    +
    @@ -170,66 +100,65 @@

    adjustcarryforward excluded as carried forward values for reinclusion.

    -
    adjustcarryforward(
    -  subjid,
    -  param,
    -  agedays,
    -  sex,
    -  measurement,
    -  orig.exclude,
    -  exclude_opt = 0,
    -  sd.recenter = NA,
    -  ewma.exp = -1.5,
    -  ref.data.path = "",
    -  quietly = T,
    -  minfactor = 0.5,
    -  maxfactor = 2,
    -  banddiff = 3,
    -  banddiff_plus = 5.5,
    -  min_ht.exp_under = 2,
    -  min_ht.exp_over = 0,
    -  max_ht.exp_under = 0.33,
    -  max_ht.exp_over = 1.5
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    subjid

    Vector of unique identifiers for each subject in the database.

    param

    Vector identifying each measurement, may be 'WEIGHTKG', 'HEIGHTCM', or 'LENGTHCM' +

    +
    adjustcarryforward(
    +  subjid,
    +  param,
    +  agedays,
    +  sex,
    +  measurement,
    +  orig.exclude,
    +  exclude_opt = 0,
    +  sd.recenter = NA,
    +  ewma.exp = -1.5,
    +  ref.data.path = "",
    +  quietly = TRUE,
    +  minfactor = 0.5,
    +  maxfactor = 2,
    +  banddiff = 3,
    +  banddiff_plus = 5.5,
    +  min_ht.exp_under = 2,
    +  min_ht.exp_over = 0,
    +  max_ht.exp_under = 0.33,
    +  max_ht.exp_over = 1.5
    +)
    +
    + +
    +

    Arguments

    +
    subjid
    +

    Vector of unique identifiers for each subject in the database.

    + + +
    param
    +

    Vector identifying each measurement, may be 'WEIGHTKG', 'HEIGHTCM', or 'LENGTHCM' 'HEIGHTCM' vs. 'LENGTHCM' only affects z-score calculations between ages 24 to 35 months (730 to 1095 days). All linear measurements below 731 days of life (age 0-23 months) are interpreted as supine length, and all linear measurements above 1095 days of life (age 36+ months) are interpreted as standing height. -Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference.

    agedays

    Numeric vector containing the age in days at each measurement.

    sex

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', -'f' or 1 for females.

    measurement

    Numeric vector containing the actual measurement data. Weight must be in -kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

    orig.exclude

    Vector of exclusion assessment results from cleangrowth()

    exclude_opt

    Number from 0 to 3 indicating which option to use to handle strings of carried-forwards: -0. no change.

      -
    1. when deciding to exclude values, if we have a string of carried forwards, +Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference.

      + + +
      agedays
      +

      Numeric vector containing the age in days at each measurement.

      + + +
      sex
      +

      Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', +'f' or 1 for females.

      + + +
      measurement
      +

      Numeric vector containing the actual measurement data. Weight must be in +kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

      + + +
      orig.exclude
      +

      Vector of exclusion assessment results from cleangrowth()

      + + +
      exclude_opt
      +

      Number from 0 to 3 indicating which option to use to handle strings of carried-forwards: +0. no change.

      1. when deciding to exclude values, if we have a string of carried forwards, drop the most deviant value, and all CFs in the same string, and move on as normal.

      2. when deciding to exclude values, if the most deviant in a @@ -242,112 +171,112 @@

        Arg string from 1:N. Exclude all after the first that is flagged for exclusion when comparing to the Include before and after. Make sure remove things designated as include.

      3. -
    sd.recenter

    Data frame or table with median SD-scores per day of life

    ewma.exp

    Exponent to use for weighting measurements in the exponentially weighted moving + + + +

    sd.recenter
    +

    Data frame or table with median SD-scores per day of life

    + + +
    ewma.exp
    +

    Exponent to use for weighting measurements in the exponentially weighted moving average calculations. Defaults to -1.5. This exponent should be negative in order to weight growth measurements closer to the measurement being evaluated more strongly. Exponents that are further from zero (e.g. -3) will increase the relative influence of measurements close in time to the measurement -being evaluated compared to using the default exponent.

    ref.data.path

    Path to reference data. If not supplied, the year 2000 -Centers for Disease Control (CDC) reference data will be used.

    quietly

    Determines if function messages are to be displayed and if log files (parallel only) -are to be generated. Defaults to TRUE.

    minfactor

    Sweep variable for computing mindiff.next.ht in 15f, default 0.5

    maxfactor

    Sweep variable for computing maxdiff.next.ht in 15f, default 2

    banddiff

    Sweep variable for computing mindiff.next.ht in 15f, default 3

    banddiff_plus

    Sweep variable for computing maxdiff.next.ht in 15, default 5.5

    min_ht.exp_under

    Sweep variable for computing ht.exp in 15f, default 2

    min_ht.exp_over

    Sweep variable for computing ht.exp in 15f, default 0

    max_ht.exp_under

    Sweep variable for computing ht.exp in 15f, default 0.33

    max_ht.exp_over

    Sweep variable for computing ht.exp in 15f, default 1.5

    - -

    Value

    - -

    Re-evaluated exclusion assessments based on height velocity.

    - -

    Examples

    -
    # Run on a small subset of given data -df <- as.data.frame(syngrowth) -df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ] -clean_df <- cbind(df, - "gcr_result" = cleangrowth(df$subjid, - df$param, - df$agedays, - df$sex, - df$measurement)) - -# Adjust carry forward values in cleaned data -adj_clean <- adjustcarryforward(subjid = clean_df$subjid, - param = clean_df$param, - agedays = clean_df$agedays, - sex = clean_df$sex, - measurement = clean_df$measurement, - orig.exclude = clean_df$gcr_result) -
    +being evaluated compared to using the default exponent.

    + + +
    ref.data.path
    +

    Path to reference data. If not supplied, the year 2000 +Centers for Disease Control (CDC) reference data will be used.

    + + +
    quietly
    +

    Determines if function messages are to be displayed and if log files (parallel only) +are to be generated. Defaults to TRUE.

    + + +
    minfactor
    +

    Sweep variable for computing mindiff.next.ht in 15f, default 0.5

    + + +
    maxfactor
    +

    Sweep variable for computing maxdiff.next.ht in 15f, default 2

    + + +
    banddiff
    +

    Sweep variable for computing mindiff.next.ht in 15f, default 3

    + + +
    banddiff_plus
    +

    Sweep variable for computing maxdiff.next.ht in 15, default 5.5

    + + +
    min_ht.exp_under
    +

    Sweep variable for computing ht.exp in 15f, default 2

    + + +
    min_ht.exp_over
    +

    Sweep variable for computing ht.exp in 15f, default 0

    + + +
    max_ht.exp_under
    +

    Sweep variable for computing ht.exp in 15f, default 0.33

    + + +
    max_ht.exp_over
    +

    Sweep variable for computing ht.exp in 15f, default 1.5

    + +
    +
    +

    Value

    + + +

    Re-evaluated exclusion assessments based on height velocity.

    +
    + +
    +

    Examples

    +
    # Run on a small subset of given data
    +df <- as.data.frame(syngrowth)
    +df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ]
    +clean_df <- cbind(df,
    +                  "gcr_result" = cleangrowth(df$subjid,
    +                                             df$param,
    +                                             df$agedays,
    +                                             df$sex,
    +                                             df$measurement))
    +
    +# Adjust carry forward values in cleaned data
    +adj_clean <- adjustcarryforward(subjid = clean_df$subjid,
    +                                param = clean_df$param,
    +                                agedays = clean_df$agedays,
    +                                sex = clean_df$sex,
    +                                measurement = clean_df$measurement,
    +                                orig.exclude = clean_df$gcr_result)
    +
    +
    + -
    - +
    - - + + diff --git a/docs/reference/bmianthro.html b/docs/reference/bmianthro.html index 0f712c26..20f68a39 100644 --- a/docs/reference/bmianthro.html +++ b/docs/reference/bmianthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -115,7 +115,7 @@

    bmianthro.txt.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/cleangrowth.html b/docs/reference/cleangrowth.html index 47330833..7d205557 100644 --- a/docs/reference/cleangrowth.html +++ b/docs/reference/cleangrowth.html @@ -1,67 +1,12 @@ - - - - - - - -Clean growth measurements — cleangrowth • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Clean growth measurements — cleangrowth • growthcleanr - - + + - - -
    -
    - -
    - -
    +
    @@ -160,255 +90,256 @@

    Clean growth measurements

    Clean growth measurements

    -
    cleangrowth(
    -  subjid,
    -  param,
    -  agedays,
    -  sex,
    -  measurement,
    -  recover.unit.error = F,
    -  sd.extreme = 25,
    -  z.extreme = 25,
    -  lt3.exclude.mode = "default",
    -  height.tolerance.cm = 2.5,
    -  error.load.mincount = 2,
    -  error.load.threshold = 0.5,
    -  sd.recenter = NA,
    -  sdmedian.filename = "",
    -  sdrecentered.filename = "",
    -  include.carryforward = F,
    -  ewma.exp = -1.5,
    -  ref.data.path = "",
    -  log.path = ".",
    -  parallel = F,
    -  num.batches = NA,
    -  quietly = T,
    -  adult_cutpoint = 20,
    -  weight_cap = Inf,
    -  adult_columns_filename = ""
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    subjid

    Vector of unique identifiers for each subject in the database.

    param

    Vector identifying each measurement, may be 'WEIGHTKG', 'WEIGHTLBS', 'HEIGHTCM', 'HEIGHTIN', or 'LENGTHCM' +

    +
    cleangrowth(
    +  subjid,
    +  param,
    +  agedays,
    +  sex,
    +  measurement,
    +  recover.unit.error = FALSE,
    +  sd.extreme = 25,
    +  z.extreme = 25,
    +  lt3.exclude.mode = "default",
    +  height.tolerance.cm = 2.5,
    +  error.load.mincount = 2,
    +  error.load.threshold = 0.5,
    +  sd.recenter = NA,
    +  sdmedian.filename = "",
    +  sdrecentered.filename = "",
    +  include.carryforward = FALSE,
    +  ewma.exp = -1.5,
    +  ref.data.path = "",
    +  log.path = NA,
    +  parallel = FALSE,
    +  num.batches = NA,
    +  quietly = TRUE,
    +  adult_cutpoint = 20,
    +  weight_cap = Inf,
    +  adult_columns_filename = ""
    +)
    +
    + +
    +

    Arguments

    +
    subjid
    +

    Vector of unique identifiers for each subject in the database.

    + + +
    param
    +

    Vector identifying each measurement, may be 'WEIGHTKG', 'WEIGHTLBS', 'HEIGHTCM', 'HEIGHTIN', or 'LENGTHCM' 'HEIGHTCM'/'HEIGHTIN' vs. 'LENGTHCM' only affects z-score calculations between ages 24 to 35 months (730 to 1095 days). All linear measurements below 731 days of life (age 0-23 months) are interpreted as supine length, and all linear measurements above 1095 days of life (age 36+ months) are interpreted as standing height. Note: at the moment, all LENGTHCM will be converted to HEIGHTCM. In the future, the algorithm will be updated to consider this difference. Additionally, imperial 'HEIGHTIN' and 'WEIGHTLBS' measurements are converted to -metric during algorithm calculations.

    agedays

    Numeric vector containing the age in days at each measurement.

    sex

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', 'f' or 1 for females.

    measurement

    Numeric vector containing the actual measurement data. Weight must be in -kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

    recover.unit.error

    Indicates whether the cleaning algorithm should +metric during algorithm calculations.

    + + +
    agedays
    +

    Numeric vector containing the age in days at each measurement.

    + + +
    sex
    +

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', 'f' or 1 for females.

    + + +
    measurement
    +

    Numeric vector containing the actual measurement data. Weight must be in +kilograms (kg), and linear measurements (height vs. length) in centimeters (cm).

    + + +
    recover.unit.error
    +

    Indicates whether the cleaning algorithm should attempt to identify unit errors (I.e. inches vs. cm, lbs vs. kg). If unit errors are identified, the value will be corrected and retained within the -cleaning algorithm as a valid measurement. Defaults to FALSE.

    sd.extreme

    Measurements more than sd.extreme standard deviations from -the mean (either above or below) will be flagged as invalid. Defaults to 25.

    z.extreme

    Measurements with an absolute z-score greater than -z.extreme will be flagged as invalid. Defaults to 25.

    lt3.exclude.mode

    Determines type of exclusion procedure to use for 1 or 2 measurements of one type without +cleaning algorithm as a valid measurement. Defaults to FALSE.

    + + +
    sd.extreme
    +

    Measurements more than sd.extreme standard deviations from +the mean (either above or below) will be flagged as invalid. Defaults to 25.

    + + +
    z.extreme
    +

    Measurements with an absolute z-score greater than +z.extreme will be flagged as invalid. Defaults to 25.

    + + +
    lt3.exclude.mode
    +

    Determines type of exclusion procedure to use for 1 or 2 measurements of one type without matching same ageday measurements for the other parameter. Options include "default" (standard growthcleanr approach), and "flag.both" (in case of two measurements of one type without matching values for the other parameter, flag both -for exclusion if beyond threshold)

    height.tolerance.cm

    maximum decrease in height tolerated for sequential measurements

    error.load.mincount

    minimum count of exclusions on parameter before -considering excluding all measurements. Defaults to 2.

    error.load.threshold

    threshold of percentage of excluded measurement count to included measurement -count that must be exceeded before excluding all measurements of either parameter. Defaults to 0.5.

    sd.recenter

    specifies how to recenter medians. May be a data frame or +for exclusion if beyond threshold)

    + + +
    height.tolerance.cm
    +

    maximum decrease in height tolerated for sequential measurements

    + + +
    error.load.mincount
    +

    minimum count of exclusions on parameter before +considering excluding all measurements. Defaults to 2.

    + + +
    error.load.threshold
    +

    threshold of percentage of excluded measurement count to included measurement +count that must be exceeded before excluding all measurements of either parameter. Defaults to 0.5.

    + + +
    sd.recenter
    +

    specifies how to recenter medians. May be a data frame or table w/median SD-scores per day of life by gender and parameter, or "NHANES" -or "derive" as a character vector.

      -
    • If sd.recenter is specified as a data set, use the data set

    • +or "derive" as a character vector.

      • If sd.recenter is specified as a data set, use the data set

      • If sd.recenter is specified as "nhanes", use NHANES reference medians

      • If sd.recenter is specified as "derive", derive from input

      • -
      • If sd.recenter is not specified or NA:

          -
        • If the input set has at least 5,000 observations, derive medians from input

        • +
        • If sd.recenter is not specified or NA:

          • If the input set has at least 5,000 observations, derive medians from input

          • If the input set has fewer than 5,000 observations, use NHANES

        • -
        - -

        If specifying a data set, columns must include param, sex, agedays, and sd.median +

      If specifying a data set, columns must include param, sex, agedays, and sd.median (referred to elsewhere as "modified Z-score"), and those medians will be used for recentering. A summary of how the NHANES reference medians were derived is -available in README.md. Defaults to NA.

    sdmedian.filename

    Name of file to save sd.median data calculated on the input dataset to as CSV. +available in README.md. Defaults to NA.

    + + +
    sdmedian.filename
    +

    Name of file to save sd.median data calculated on the input dataset to as CSV. Defaults to "", for which this data will not be saved. Use for extracting medians for parallel processing -scenarios other than the built-in parallel option.

    sdrecentered.filename

    Name of file to save re-centered data to as CSV. Defaults to "", for which this -data will not be saved. Useful for post-processing and debugging.

    include.carryforward

    Determines whether Carry-Forward values are kept in the output. Defaults to False.

    ewma.exp

    Exponent to use for weighting measurements in the +scenarios other than the built-in parallel option.

    + + +
    sdrecentered.filename
    +

    Name of file to save re-centered data to as CSV. Defaults to "", for which this +data will not be saved. Useful for post-processing and debugging.

    + + +
    include.carryforward
    +

    Determines whether Carry-Forward values are kept in the output. Defaults to False.

    + + +
    ewma.exp
    +

    Exponent to use for weighting measurements in the exponentially weighted moving average calculations. Defaults to -1.5. This exponent should be negative in order to weight growth measurements closer to the measurement being evaluated more strongly. Exponents that are further from zero (e.g. -3) will increase the relative influence of measurements close in time to the measurement being evaluated compared to -using the default exponent.

    ref.data.path

    Path to reference data. If not supplied, the year 2000 -Centers for Disease Control (CDC) reference data will be used.

    log.path

    Path to log file output when running in parallel (non-quiet mode). Default is ".". A new -directory will be created if necessary. Set to NA to disable log files.

    parallel

    Determines if function runs in parallel. Defaults to FALSE.

    num.batches

    Specify the number of batches to run in parallel. Only +using the default exponent.

    + + +
    ref.data.path
    +

    Path to reference data. If not supplied, the year 2000 +Centers for Disease Control (CDC) reference data will be used.

    + + +
    log.path
    +

    Path to log file output when running in parallel (non-quiet mode). Default is NA. A new +directory will be created if necessary. Set to NA to disable log files.

    + + +
    parallel
    +

    Determines if function runs in parallel. Defaults to FALSE.

    + + +
    num.batches
    +

    Specify the number of batches to run in parallel. Only applies if parallel is set to TRUE. Defaults to the number of workers -returned by the getDoParWorkers function in the foreach package.

    quietly

    Determines if function messages are to be displayed and if log files (parallel only) are to be generated. -Defaults to TRUE

    adult_cutpoint

    Number between 18 and 20, describing ages when the +returned by the getDoParWorkers function in the foreach package.

    + + +
    quietly
    +

    Determines if function messages are to be displayed and if log files (parallel only) are to be generated. +Defaults to TRUE

    + + +
    adult_cutpoint
    +

    Number between 18 and 20, describing ages when the pediatric algorithm should not be applied (< adult_cutpoint), and the adult algorithm should apply (>= adult_cutpoint). Numbers outside this range will be -changed to the closest number within the range. Defaults to 20.

    weight_cap

    Positive number, describing a weight cap in kg (rounded to the +changed to the closest number within the range. Defaults to 20.

    + + +
    weight_cap
    +

    Positive number, describing a weight cap in kg (rounded to the nearest .1, +/- .1) within the adult dataset. If there is no weight cap, set -to Inf. Defaults to Inf.

    adult_columns_filename

    Name of file to save original adult data, with additional output columns to +to Inf. Defaults to Inf.

    + + +
    adult_columns_filename
    +

    Name of file to save original adult data, with additional output columns to as CSV. Defaults to "", for which this data will not be saved. Useful -for post-analysis. For more information on this output, please see README.

    +for post-analysis. For more information on this output, please see README.

    -

    Value

    +
    +
    +

    Value

    + -

    Vector of exclusion codes for each of the input measurements.

    -

    Possible values for each code are:

      -
    • 'Include', 'Unit-Error-High', 'Unit-Error-Low', 'Swapped-Measurements', 'Missing',

    • +

      Vector of exclusion codes for each of the input measurements.

      + + +

      Possible values for each code are:

      • 'Include', 'Unit-Error-High', 'Unit-Error-Low', 'Swapped-Measurements', 'Missing',

      • 'Exclude-Carried-Forward', 'Exclude-SD-Cutoff', 'Exclude-EWMA-Extreme', 'Exclude-EWMA-Extreme-Pair',

      • 'Exclude-Extraneous-Same-Day',

      • 'Exclude-EWMA-8', 'Exclude-EWMA-9', 'Exclude-EWMA-10', 'Exclude-EWMA-11', 'Exclude-EWMA-12', 'Exclude-EWMA-13', 'Exclude-EWMA-14',

      • 'Exclude-Min-Height-Change', 'Exclude-Max-Height-Change',

      • 'Exclude-Pair-Delta-17', 'Exclude-Pair-Delta-18', 'Exclude-Pair-Delta-19',

      • 'Exclude-Single-Outlier', 'Exclude-Too-Many-Errors', 'Exclude-Too-Many-Errors-Other-Parameter'

      • -
      - - -

      Examples

      -
      # Run calculation using a small subset of given data -df_stats <- as.data.frame(syngrowth) -df_stats <- df_stats[df_stats$subjid %in% unique(df_stats[, "subjid"])[1:5], ] - -clean_stats <-cleangrowth(subjid = df_stats$subjid, - param = df_stats$param, - agedays = df_stats$agedays, - sex = df_stats$sex, - measurement = df_stats$measurement) - -# Once processed you can filter data based on result value -df_stats <- cbind(df_stats, "clean_result" = clean_stats) -clean_df_stats <- df_stats[df_stats$clean_result == "Include",] - -# Parallel processing: run using 2 cores and batches -clean_stats <- cleangrowth(subjid = df_stats$subjid, - param = df_stats$param, - agedays = df_stats$agedays, - sex = df_stats$sex, - measurement = df_stats$measurement, - parallel = TRUE, - num.batches = 2) -
      #> [2021-07-06 10:53:04] Writing batch logs to '.'...
      #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
      #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
      #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
      #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
      +
    + +
    +

    Examples

    +
    # \donttest{
    +# Run calculation using a small subset of given data
    +df_stats <- as.data.frame(syngrowth)
    +df_stats <- df_stats[df_stats$subjid %in% unique(df_stats[, "subjid"])[1:5], ]
    +
    +clean_stats <-cleangrowth(subjid = df_stats$subjid,
    +                         param = df_stats$param,
    +                         agedays = df_stats$agedays,
    +                         sex = df_stats$sex,
    +                         measurement = df_stats$measurement)
    +
    +# Once processed you can filter data based on result value
    +df_stats <- cbind(df_stats, "clean_result" = clean_stats)
    +clean_df_stats <- df_stats[df_stats$clean_result == "Include",]
    +
    +# Parallel processing: run using 2 cores and batches
    +clean_stats <- cleangrowth(subjid = df_stats$subjid,
    +                           param = df_stats$param,
    +                           agedays = df_stats$agedays,
    +                           sex = df_stats$sex,
    +                           measurement = df_stats$measurement,
    +                           parallel = TRUE,
    +                           num.batches = 2)
    +#> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
    +#> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
    +#> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
    +#> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/ewma.html b/docs/reference/ewma.html index 7e4fa819..ca7d1aee 100644 --- a/docs/reference/ewma.html +++ b/docs/reference/ewma.html @@ -1,67 +1,12 @@ - - - - - - - -Exponentially Weighted Moving Average (EWMA) — ewma • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Exponentially Weighted Moving Average (EWMA) — ewma • growthcleanr - - + + - - -
    -
    - -
    - -
    +
    @@ -160,83 +90,80 @@

    Exponentially Weighted Moving Average (EWMA)

    ewma calculates the exponentially weighted moving average (EWMA) for a set of numeric observations over time.

    -
    ewma(agedays, z, ewma.exp, ewma.adjacent = T)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    agedays

    Vector of age in days for each z score (potentially transformed to adjust weighting).

    z

    Input vector of numeric z-score data.

    ewma.exp

    Exponent to use for weighting.

    ewma.adjacent

    Specify whether EWMA values excluding adjacent measurements should be calculated. Defaults to TRUE.

    - -

    Value

    - -

    Data frame with 3 variables:

      -
    • The first variable (ewma.all) contains the EWMA at observation time +

      +
      ewma(agedays, z, ewma.exp, ewma.adjacent = TRUE)
      +
      + +
      +

      Arguments

      +
      agedays
      +

      Vector of age in days for each z score (potentially transformed to adjust weighting).

      + + +
      z
      +

      Input vector of numeric z-score data.

      + + +
      ewma.exp
      +

      Exponent to use for weighting.

      + + +
      ewma.adjacent
      +

      Specify whether EWMA values excluding adjacent measurements should be calculated. Defaults to TRUE.

      + +
      +
      +

      Value

      + + +

      Data frame with 3 variables:

      • The first variable (ewma.all) contains the EWMA at observation time excluding only the actual observation for that time point.

      • The second variable (ewma.before) contains the EWMA for each observation excluding both the actual observation and the immediate prior observation.

      • The third variable (ewma.after) contains the EWMA for each observation excluding both the actual observation and the subsequent observation.

      • -
      - - -

      Examples

      -
      # Run on 1 subject, 1 type of parameter -df_stats <- as.data.frame(syngrowth) -df_stats <- df_stats[df_stats$subjid == df_stats$subjid[1] & - df_stats$param == "HEIGHTCM", ] - -# Get the uncentered z-scores -measurement_to_z <- read_anthro(cdc.only = TRUE) -sd <- measurement_to_z(df_stats$param, - df_stats$agedays, - df_stats$sex, - df_stats$measurement, - TRUE) - -# Calculate exponentially weighted moving average -e_df <- ewma(df_stats$agedays, sd, ewma.exp = -1.5) -
      +
    + +
    +

    Examples

    +
    # Run on 1 subject, 1 type of parameter
    +df_stats <- as.data.frame(syngrowth)
    +df_stats <- df_stats[df_stats$subjid == df_stats$subjid[1] &
    +                       df_stats$param == "HEIGHTCM", ]
    +
    +# Get the uncentered z-scores
    +measurement_to_z <- read_anthro(cdc.only = TRUE)
    +sd <- measurement_to_z(df_stats$param,
    +                       df_stats$agedays,
    +                       df_stats$sex,
    +                       df_stats$measurement,
    +                       TRUE)
    +
    +# Calculate exponentially weighted moving average
    +e_df <- ewma(df_stats$agedays, sd, ewma.exp = -1.5)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/ext_bmiz.html b/docs/reference/ext_bmiz.html index b4023ffc..d709160d 100644 --- a/docs/reference/ext_bmiz.html +++ b/docs/reference/ext_bmiz.html @@ -1,72 +1,17 @@ - - - - - - - -Calculate extended BMI measures — ext_bmiz • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Calculate extended BMI measures — ext_bmiz • growthcleanr - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -170,57 +100,61 @@

    Calculate extended BMI measures

    differ only for children who have a BMI > 95th percentile.

    -
    ext_bmiz(
    -  data,
    -  age = "agem",
    -  wt = "wt",
    -  ht = "ht",
    -  bmi = "bmi",
    -  adjust.integer.age = T,
    -  ref.data.path = ""
    -)
    +
    +
    ext_bmiz(
    +  data,
    +  age = "agem",
    +  wt = "wt",
    +  ht = "ht",
    +  bmi = "bmi",
    +  adjust.integer.age = TRUE,
    +  ref.data.path = ""
    +)
    +
    + +
    +

    Arguments

    +
    data
    +

    Input data frame or data table

    + + +
    age
    +

    Name of input column containing subject age in months in quotes, default "agem"

    + + +
    wt
    +

    Name of input column containing weight (kg) value in quotes, default "wt"

    + + +
    ht
    +

    Name of input column containing height (cm) value in quotes, default "ht"

    -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    data

    Input data frame or data table

    age

    Name of input column containing subject age in months in quotes, default "agem"

    wt

    Name of input column containing weight (kg) value in quotes, default "wt"

    ht

    Name of input column containing height (cm) value in quotes, default "ht"

    bmi

    Name of input column containing calculated BMI in quotes, default "bmi"

    adjust.integer.age

    If age inputs are all integer, add 0.5 if TRUE; -default TRUE

    ref.data.path

    Path to directory containing reference data

    -

    Value

    +
    bmi
    +

    Name of input column containing calculated BMI in quotes, default "bmi"

    -

    Expanded data frame containing computed BMI values

    -

    Details

    +
    adjust.integer.age
    +

    If age inputs are all integer, add 0.5 if TRUE; +default TRUE

    + + +
    ref.data.path
    +

    Path to directory containing reference data

    + +
    +
    +

    Value

    + + +

    Expanded data frame containing computed BMI values

    +
    +
    +

    Details

    This function should produce output equivalent to the SAS macro provided at -https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm

    +https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm. The macro +was updated in December, 2022, and this function has been updated to match it +as of growthcleanr v2.1.0.

    The extended BMIz is the inverse cumulative distribution function (CDF) of the extended BMI percentile. If the extended percentile is very close to 100, the qnorm function in R produces an infinite value. This occurs @@ -249,58 +183,57 @@

    Details in this package for convenience. If you are developing this package, use ref.data.path to adjust the path to this file from your working directory if necessary.

    +

    -

    Examples

    -
    # Run on a small subset of given data -df <- as.data.frame(syngrowth) -df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ] -df <- cbind(df, - "gcr_result" = cleangrowth(df$subjid, - df$param, - df$agedays, - df$sex, - df$measurement)) -df_wide <- longwide(df) # convert to wide format for ext_bmiz -df_wide_bmi <- simple_bmi(df_wide) # compute simple BMI - -# Calling the function with default column names -df_bmiz <- ext_bmiz(df_wide_bmi) - -# Specifying different column names; note that quotes are used -dfc <- simple_bmi(df_wide) -colnames(dfc)[colnames(dfc) %in% c("agem", "wt", "ht")] <- - c("agemos", "weightkg", "heightcm") -df_bmiz <- ext_bmiz(dfc, age="agemos", wt="weightkg", ht="heightcm") - -# Disabling conversion of all-integer age in months to (age + 0.5) -dfc <- simple_bmi(df_wide) -df_bmiz <- ext_bmiz(dfc, adjust.integer.age=FALSE) -
    +
    +

    Examples

    +
    # Run on a small subset of given data
    +df <- as.data.frame(syngrowth)
    +df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ]
    +df <- cbind(df,
    +            "gcr_result" = cleangrowth(df$subjid,
    +                                       df$param,
    +                                       df$agedays,
    +                                       df$sex,
    +                                       df$measurement))
    +df_wide <- longwide(df) # convert to wide format for ext_bmiz
    +df_wide_bmi <- simple_bmi(df_wide) # compute simple BMI
    +
    +# Calling the function with default column names
    +df_bmiz <- ext_bmiz(df_wide_bmi)
    +
    +# Specifying different column names; note that quotes are used
    +dfc <- simple_bmi(df_wide)
    +colnames(dfc)[colnames(dfc) %in% c("agem", "wt", "ht")] <-
    +  c("agemos", "weightkg", "heightcm")
    +df_bmiz <- ext_bmiz(dfc, age="agemos", wt="weightkg", ht="heightcm")
    +
    +# Disabling conversion of all-integer age in months to (age + 0.5)
    +dfc <- simple_bmi(df_wide)
    +df_bmiz <- ext_bmiz(dfc, adjust.integer.age=FALSE)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/growth_cdc_ext.html b/docs/reference/growth_cdc_ext.html index 8f4dedeb..d10d5d74 100644 --- a/docs/reference/growth_cdc_ext.html +++ b/docs/reference/growth_cdc_ext.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -115,7 +115,7 @@

    growthfile_cdc_ext.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index 2fbb4f2e..b3a8fc73 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -227,7 +227,7 @@

    Datasets

    pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/lenanthro.html b/docs/reference/lenanthro.html index 84fdf7c6..886def9c 100644 --- a/docs/reference/lenanthro.html +++ b/docs/reference/lenanthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -115,7 +115,7 @@

    lenanthro.txt.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/longwide.html b/docs/reference/longwide.html index 010e12ca..81c9244f 100644 --- a/docs/reference/longwide.html +++ b/docs/reference/longwide.html @@ -1,67 +1,12 @@ - - - - - - - -Transform data in growthcleanr format into wide structure for BMI calculation — longwide • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Transform data in growthcleanr format into wide structure for BMI calculation — longwide • growthcleanr - - + + - - -
    -
    - -
    - -
    +
    @@ -160,112 +90,112 @@

    Transform data in growthcleanr format into wide structure for BMI calculatio

    longwide transforms data from long to wide format. Ideal for transforming output from growthcleanr::cleangrowth() into a format suitable for growthcleanr::ext_bmiz().

    -
    longwide(
    -  long_df,
    -  id = "id",
    -  subjid = "subjid",
    -  sex = "sex",
    -  agedays = "agedays",
    -  param = "param",
    -  measurement = "measurement",
    -  gcr_result = "gcr_result",
    -  include_all = FALSE,
    -  inclusion_types = c("Include")
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    long_df

    A data frame to be transformed. Expects columns: id, subjid, sex, agedays, param, measurement, and gcr_result.

    id

    name of observation ID column

    subjid

    name of subject ID column

    sex

    name of sex descriptor column

    agedays

    name of age (in days) descriptor column

    param

    name of parameter column to identify each type of measurement

    measurement

    name of measurement column containing the actual measurement data

    gcr_result

    name of column of results from growthcleanr::cleangrowth()

    include_all

    Determines whether the function keeps all exclusion codes. If TRUE, all exclusion types are kept and the inclusion_types argument is ignored. Defaults to FALSE.

    inclusion_types

    Vector indicating which exclusion codes from the cleaning algorithm should be included in the data, given that include_all is FALSE. For all options, see growthcleanr::cleangrowth(). Defaults to c("Include").

    - -

    Value

    - -

    Returns a data frame transformed from long to wide. Includes only values flagged with indicated inclusion types. Note that, for each subject, heights without corresponding weights for a given age (and vice versa) will be dropped.

    - -

    Examples

    -
    # Run on a small subset of given data -df <- as.data.frame(syngrowth) -df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ] -df <- cbind(df, - "gcr_result" = cleangrowth(df$subjid, - df$param, - df$agedays, - df$sex, - df$measurement)) -# Convert to wide format -wide_df <- longwide(df) - -# Include all inclusion types -wide_df <- longwide(df, include_all = TRUE) - -# Specify all inclusion codes -wide_df <- longwide(df, inclusion_types = c("Include", "Exclude-Carried-Forward")) -
    +
    +
    longwide(
    +  long_df,
    +  id = "id",
    +  subjid = "subjid",
    +  sex = "sex",
    +  agedays = "agedays",
    +  param = "param",
    +  measurement = "measurement",
    +  gcr_result = "gcr_result",
    +  include_all = FALSE,
    +  inclusion_types = c("Include")
    +)
    +
    + +
    +

    Arguments

    +
    long_df
    +

    A data frame to be transformed. Expects columns: id, subjid, sex, agedays, param, measurement, and gcr_result.

    + + +
    id
    +

    name of observation ID column

    + + +
    subjid
    +

    name of subject ID column

    + + +
    sex
    +

    name of sex descriptor column

    + + +
    agedays
    +

    name of age (in days) descriptor column

    + + +
    param
    +

    name of parameter column to identify each type of measurement

    + + +
    measurement
    +

    name of measurement column containing the actual measurement data

    + + +
    gcr_result
    +

    name of column of results from growthcleanr::cleangrowth()

    + + +
    include_all
    +

    Determines whether the function keeps all exclusion codes. If TRUE, all exclusion types are kept and the inclusion_types argument is ignored. Defaults to FALSE.

    + + +
    inclusion_types
    +

    Vector indicating which exclusion codes from the cleaning algorithm should be included in the data, given that include_all is FALSE. For all options, see growthcleanr::cleangrowth(). Defaults to c("Include").

    + +
    +
    +

    Value

    + + +

    Returns a data frame transformed from long to wide. Includes only values flagged with indicated inclusion types. Note that, for each subject, heights without corresponding weights for a given age (and vice versa) will be dropped.

    +
    + +
    +

    Examples

    +
    # Run on a small subset of given data
    +df <- as.data.frame(syngrowth)
    +df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ]
    +df <- cbind(df,
    +            "gcr_result" = cleangrowth(df$subjid,
    +                                       df$param,
    +                                       df$agedays,
    +                                       df$sex,
    +                                       df$measurement))
    +# Convert to wide format
    +wide_df <- longwide(df)
    +
    +# Include all inclusion types
    +wide_df <- longwide(df, include_all = TRUE)
    +
    +# Specify all inclusion codes
    +wide_df <- longwide(df, inclusion_types = c("Include", "Exclude-Carried-Forward"))
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/nhanes-reference-medians.html b/docs/reference/nhanes-reference-medians.html index b5d5d6ce..ada4a21a 100644 --- a/docs/reference/nhanes-reference-medians.html +++ b/docs/reference/nhanes-reference-medians.html @@ -18,7 +18,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -113,7 +113,7 @@

    nhanes-reference-medians.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/read_anthro.html b/docs/reference/read_anthro.html index 3b79c135..1a240395 100644 --- a/docs/reference/read_anthro.html +++ b/docs/reference/read_anthro.html @@ -1,67 +1,12 @@ - - - - - - - -Function to calculate z-scores and csd-scores based on anthro tables. — read_anthro • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function to calculate z-scores and csd-scores based on anthro tables. — read_anthro • growthcleanr - + + - - - -
    -
    - -
    - -
    +
    @@ -160,58 +90,58 @@

    Function to calculate z-scores and csd-scores based on anthro tables.

    Function to calculate z-scores and csd-scores based on anthro tables.

    -
    read_anthro(path = "", cdc.only = F)
    - -

    Arguments

    - - - - - - - - - - -
    path

    Path to supplied reference anthro data. Defaults to package anthro tables.

    cdc.only

    Whether or not only CDC data should be used. Defaults to false.

    - -

    Value

    - -

    Function for calculating BMI based on measurement, age in days, sex, and measurement value.

    - -

    Examples

    -
    # Return calculating function with all defaults -afunc <- read_anthro() - -# Return calculating function while specifying a path and using only CDC data -afunc <- read_anthro(path = system.file("extdata", package = "growthcleanr"), - cdc.only = TRUE) -
    +
    +
    read_anthro(path = "", cdc.only = FALSE)
    +
    + +
    +

    Arguments

    +
    path
    +

    Path to supplied reference anthro data. Defaults to package anthro tables.

    + + +
    cdc.only
    +

    Whether or not only CDC data should be used. Defaults to false.

    + +
    +
    +

    Value

    + + +

    Function for calculating BMI based on measurement, age in days, sex, and measurement value.

    +
    + +
    +

    Examples

    +
    # Return calculating function with all defaults
    +afunc <- read_anthro()
    +
    +# Return calculating function while specifying a path and using only CDC data
    +afunc <- read_anthro(path = system.file("extdata", package = "growthcleanr"),
    +                     cdc.only = TRUE)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/recode_sex.html b/docs/reference/recode_sex.html index 2532cf5d..8abb3221 100644 --- a/docs/reference/recode_sex.html +++ b/docs/reference/recode_sex.html @@ -1,68 +1,13 @@ - - - - - - - -Recode binary sex variable for compatibility — recode_sex • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Recode binary sex variable for compatibility — recode_sex • growthcleanr + + - - - - -
    -
    - -
    - -
    +
    @@ -162,91 +92,91 @@

    Recode binary sex variable for compatibility

    Useful in transforming output from growthcleanr::cleangrowth() into a format suitable for growthcleanr::ext_bmiz().

    -
    recode_sex(
    -  input_data,
    -  sourcecol = "sex",
    -  sourcem = "0",
    -  sourcef = "1",
    -  targetcol = "sex_recoded",
    -  targetm = 1L,
    -  targetf = 2L
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    input_data

    a data frame or data table to be transformed. Expects a source column containing a binary sex variable.

    sourcecol

    name of sex descriptor column. Defaults to "sex"

    sourcem

    variable indicating "male" sex in input data. Defaults to "0"

    sourcef

    variable indicating "female" sex in input data. Defaults to "1"

    targetcol

    desired name of recoded sex descriptor column. Defaults to "sex_recoded"

    targetm

    desired name of recoded sex variable indicating "male" sex in output data. Defaults to 1

    targetf

    desired name of recoded sex variable indicating "female" sex in output data. Defaults to 2

    - -

    Value

    - -

    Returns a data table with recoded sex variables.

    - -

    Examples

    -
    # Run on given data -df <- as.data.frame(syngrowth) - -# Run with all defaults -df_r <- recode_sex(df) - -# Specify different targets -df_rt <- recode_sex(df, targetcol = "sexr", targetm = "Male", targetf = "Female") - -# Specify different inputs -df_ri <- recode_sex(df_rt, sourcecol = "sexr", sourcem = "Male", sourcef = "Female") -
    +
    +
    recode_sex(
    +  input_data,
    +  sourcecol = "sex",
    +  sourcem = "0",
    +  sourcef = "1",
    +  targetcol = "sex_recoded",
    +  targetm = 1L,
    +  targetf = 2L
    +)
    +
    + +
    +

    Arguments

    +
    input_data
    +

    a data frame or data table to be transformed. Expects a source column containing a binary sex variable.

    + + +
    sourcecol
    +

    name of sex descriptor column. Defaults to "sex"

    + + +
    sourcem
    +

    variable indicating "male" sex in input data. Defaults to "0"

    + + +
    sourcef
    +

    variable indicating "female" sex in input data. Defaults to "1"

    + + +
    targetcol
    +

    desired name of recoded sex descriptor column. Defaults to "sex_recoded"

    + + +
    targetm
    +

    desired name of recoded sex variable indicating "male" sex in output data. Defaults to 1

    + + +
    targetf
    +

    desired name of recoded sex variable indicating "female" sex in output data. Defaults to 2

    + +
    +
    +

    Value

    + + +

    Returns a data table with recoded sex variables.

    +
    + +
    +

    Examples

    +
    # Run on given data
    +df <- as.data.frame(syngrowth)
    +
    +# Run with all defaults
    +df_r <- recode_sex(df)
    +
    +# Specify different targets
    +df_rt <- recode_sex(df, targetcol = "sexr", targetm = "Male", targetf = "Female")
    +
    +# Specify different inputs
    +df_ri <- recode_sex(df_rt, sourcecol = "sexr", sourcem = "Male", sourcef = "Female")
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/sd_median.html b/docs/reference/sd_median.html index ca7ea267..4a0e5a74 100644 --- a/docs/reference/sd_median.html +++ b/docs/reference/sd_median.html @@ -1,67 +1,12 @@ - - - - - - - -Calculate median SD score by age for each parameter. — sd_median • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Calculate median SD score by age for each parameter. — sd_median • growthcleanr - - - - + + -
    -
    - -
    - -
    +
    @@ -160,77 +90,77 @@

    Calculate median SD score by age for each parameter.

    Calculate median SD score by age for each parameter.

    -
    sd_median(param, sex, agedays, sd.orig)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    param

    Vector identifying each measurement, may be 'WEIGHTKG', or 'HEIGHTCM'.

    sex

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', 'f' or 1 for females.

    agedays

    Numeric vector containing the age in days at each measurement.

    sd.orig

    Vector of previously calculated standard deviation (SD) scores for each measurement before re-centering.

    - -

    Value

    - -

    Table of data with median SD-scores per day of life by gender and parameter.

    - -

    Examples

    -
    # Run on 1 subject -df_stats <- as.data.frame(syngrowth) -df_stats <- df_stats[df_stats$subjid == df_stats$subjid[1], ] - -# Get the original standard deviations -measurement_to_z <- read_anthro(cdc.only = TRUE) -sd.orig <- measurement_to_z(df_stats$param, - df_stats$agedays, - df_stats$sex, - df_stats$measurement, - TRUE) - -# Calculate median standard deviations -sd.m <- sd_median(df_stats$param, - df_stats$sex, - df_stats$agedays, - sd.orig) -
    +
    +
    sd_median(param, sex, agedays, sd.orig)
    +
    + +
    +

    Arguments

    +
    param
    +

    Vector identifying each measurement, may be 'WEIGHTKG', or 'HEIGHTCM'.

    + + +
    sex
    +

    Vector identifying the gender of the subject, may be 'M', 'm', or 0 for males, vs. 'F', 'f' or 1 for females.

    + + +
    agedays
    +

    Numeric vector containing the age in days at each measurement.

    + + +
    sd.orig
    +

    Vector of previously calculated standard deviation (SD) scores for each measurement before re-centering.

    + +
    +
    +

    Value

    + + +

    Table of data with median SD-scores per day of life by gender and parameter.

    +
    + +
    +

    Examples

    +
    # Run on 1 subject
    +df_stats <- as.data.frame(syngrowth)
    +df_stats <- df_stats[df_stats$subjid == df_stats$subjid[1], ]
    +
    +# Get the original standard deviations
    +measurement_to_z <- read_anthro(cdc.only = TRUE)
    +sd.orig <- measurement_to_z(df_stats$param,
    +                       df_stats$agedays,
    +                       df_stats$sex,
    +                       df_stats$measurement,
    +                       TRUE)
    +
    +# Calculate median standard deviations
    +sd.m <- sd_median(df_stats$param,
    +                  df_stats$sex,
    +                  df_stats$agedays,
    +                  sd.orig)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/simple_bmi.html b/docs/reference/simple_bmi.html index a34b715d..4656d371 100644 --- a/docs/reference/simple_bmi.html +++ b/docs/reference/simple_bmi.html @@ -1,68 +1,13 @@ - - - - - - - -Compute BMI using standard formula — simple_bmi • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Compute BMI using standard formula — simple_bmi • growthcleanr - - + + - - -
    -
    - -
    - -
    +
    @@ -162,75 +92,75 @@

    Compute BMI using standard formula

    output from longwide().

    -
    simple_bmi(wide_df, wtcol = "wt", htcol = "ht")
    - -

    Arguments

    - - - - - - - - - - - - - - -
    wide_df

    A data frame or data table containing heights and weights in -wide format, e.g., after transformation with longwide()

    wtcol

    name of observation height value column, default 'wt'

    htcol

    name of subject weight value column, default 'ht'

    - -

    Value

    - -

    Returns a data table with the added column "bmi"

    - -

    Examples

    -
    # Simple usage -# Run on a small subset of given data -df <- as.data.frame(syngrowth) -df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ] -df <- cbind(df, - "gcr_result" = cleangrowth(df$subjid, - df$param, - df$agedays, - df$sex, - df$measurement)) -# Convert to wide format -wide_df <- longwide(df) -wide_df_with_bmi <- simple_bmi(wide_df) - -# Specifying different column names; note that quotes are used -colnames(wide_df)[colnames(wide_df) %in% c("wt", "ht")] <- - c("weight", "height") -wide_df_with_bmi <- simple_bmi(wide_df, wtcol = "weight", htcol = "height") -
    +
    +
    simple_bmi(wide_df, wtcol = "wt", htcol = "ht")
    +
    + +
    +

    Arguments

    +
    wide_df
    +

    A data frame or data table containing heights and weights in +wide format, e.g., after transformation with longwide()

    + + +
    wtcol
    +

    name of observation height value column, default 'wt'

    + + +
    htcol
    +

    name of subject weight value column, default 'ht'

    + +
    +
    +

    Value

    + + +

    Returns a data table with the added column "bmi"

    +
    + +
    +

    Examples

    +
    # Simple usage
    +# Run on a small subset of given data
    +df <- as.data.frame(syngrowth)
    +df <- df[df$subjid %in% unique(df[, "subjid"])[1:5], ]
    +df <- cbind(df,
    +            "gcr_result" = cleangrowth(df$subjid,
    +                                       df$param,
    +                                       df$agedays,
    +                                       df$sex,
    +                                       df$measurement))
    +# Convert to wide format
    +wide_df <- longwide(df)
    +wide_df_with_bmi <- simple_bmi(wide_df)
    +
    +# Specifying different column names; note that quotes are used
    +colnames(wide_df)[colnames(wide_df) %in% c("wt", "ht")] <-
    +  c("weight", "height")
    +wide_df_with_bmi <- simple_bmi(wide_df, wtcol = "weight", htcol = "height")
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/splitinput.html b/docs/reference/splitinput.html index e7851842..199ba517 100644 --- a/docs/reference/splitinput.html +++ b/docs/reference/splitinput.html @@ -1,71 +1,16 @@ - - - - - - - -Split input data into multiple files — splitinput • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Split input data into multiple files — splitinput • growthcleanr - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -168,84 +98,87 @@

    Split input data into multiple files

    result.

    -
    splitinput(
    -  df,
    -  fname = deparse(substitute(df)),
    -  fdir = ".",
    -  min_nrow = 10000,
    -  keepcol = "subjid"
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    df

    data frame to split

    fname

    new name for each of the split files to start with

    fdir

    directory to put each of the split files (default working directory)

    min_nrow

    minimum number of rows for each split file (default 10000)

    keepcol

    the column name (default "subjid") to use to keep records with the same values together in the same single split file

    - -

    Value

    - -

    the count number referring to the last split file written

    - -

    Examples

    -
    if (FALSE) { -# Run on given data -df <- as.data.frame(syngrowth) - -# Run with all defaults -splitinput(df) - -# Specifying the name, directory and minimum row size -splitinput(df, fname = "syngrowth", fdir = tempdir(), min_nrow = 5000) - -# Specifying a different subject ID column -colnames(df)[colnames(df) == "subjid"] <- "sub_id" -splitinput(df, keepcol = "sub_id") -} -
    +
    +
    splitinput(
    +  df,
    +  fname = deparse(substitute(df)),
    +  fdir = NA,
    +  min_nrow = 10000,
    +  keepcol = "subjid"
    +)
    +
    + +
    +

    Arguments

    +
    df
    +

    data frame to split

    + + +
    fname
    +

    new name for each of the split files to start with

    + + +
    fdir
    +

    directory to put each of the split files (use "." for working directory). Must be changed from default (NA), which will trigger error.

    + + +
    min_nrow
    +

    minimum number of rows for each split file (default 10000)

    + + +
    keepcol
    +

    the column name (default "subjid") to use to keep records with the same values together in the same single split file

    + +
    +
    +

    Value

    + + +

    the count number referring to the last split file written

    +
    + +
    +

    Examples

    +
    # \donttest{
    +# Run on given data
    +df <- as.data.frame(syngrowth)
    +
    +# Run with all defaults (specifying directory)
    +splitinput(df, fdir = tempdir())
    +#> [1] 7
    +
    +# Specifying the name, directory and minimum row size
    +splitinput(df, fname = "syngrowth", fdir = tempdir(), min_nrow = 5000)
    +#> [1] 15
    +
    +# Specifying a different subject ID column
    +colnames(df)[colnames(df) == "subjid"] <- "sub_id"
    +splitinput(df, fdir = tempdir(), keepcol = "sub_id")
    +#> [1] 7
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/syngrowth.html b/docs/reference/syngrowth.html index 6f3fbcc9..9c126a5f 100644 --- a/docs/reference/syngrowth.html +++ b/docs/reference/syngrowth.html @@ -1,69 +1,14 @@ - - - - - - - -syngrowth — syngrowth • growthcleanr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -syngrowth — syngrowth • growthcleanr - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -164,42 +94,41 @@

    syngrowth

    for testing with growthcleanr. Contains both pediatric and adult data.

    -
    syngrowth
    - - -

    Format

    +
    +
    syngrowth
    +
    +
    +

    Format

    A data frame with six variables: id, subjid, sex, agedays, param, and measurement

    -

    Details

    - +
    +
    +

    Details

    Example electronic health record (heightcm, weightkg) data.

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/tanner_ht_vel.html b/docs/reference/tanner_ht_vel.html index f56f3991..188b8593 100644 --- a/docs/reference/tanner_ht_vel.html +++ b/docs/reference/tanner_ht_vel.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -115,7 +115,7 @@

    tanner_ht_vel.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/tanner_ht_vel_with_2sd.html b/docs/reference/tanner_ht_vel_with_2sd.html index da34f2f7..62977d72 100644 --- a/docs/reference/tanner_ht_vel_with_2sd.html +++ b/docs/reference/tanner_ht_vel_with_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -116,7 +116,7 @@

    tanner_ht_vel_with_2sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/test_syngrowth_sas_output_compare.html b/docs/reference/test_syngrowth_sas_output_compare.html index 814151fc..e6972c1d 100644 --- a/docs/reference/test_syngrowth_sas_output_compare.html +++ b/docs/reference/test_syngrowth_sas_output_compare.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -111,7 +111,7 @@

    test_syngrowth_sas_output_compare.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/test_syngrowth_wide.html b/docs/reference/test_syngrowth_wide.html index 7078c4f8..b77b8834 100644 --- a/docs/reference/test_syngrowth_wide.html +++ b/docs/reference/test_syngrowth_wide.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -111,7 +111,7 @@

    test_syngrowth_wide.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/testacf.html b/docs/reference/testacf.html index 2410bd0e..73c73eb2 100644 --- a/docs/reference/testacf.html +++ b/docs/reference/testacf.html @@ -20,7 +20,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -102,15 +102,15 @@

    Function to test adjust carried forward

    seed = 7, searchtype = "random", grid.length = 9, - writeout = F, + writeout = FALSE, outfile = paste0("test_adjustcarryforward_", format(Sys.time(), "%m-%d-%Y_%H-%M-%S")), - quietly = F, + quietly = FALSE, param = "none", - debug = F, + debug = FALSE, maxrecs = 0, exclude_opt = 0, - add_answers = T + add_answers = TRUE )
    @@ -187,7 +187,7 @@

    Value

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/weianthro.html b/docs/reference/weianthro.html index 1e49922e..dbffdba8 100644 --- a/docs/reference/weianthro.html +++ b/docs/reference/weianthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -115,7 +115,7 @@

    weianthro.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/who_ht_maxvel.html b/docs/reference/who_ht_maxvel.html index a7106e31..557334fe 100644 --- a/docs/reference/who_ht_maxvel.html +++ b/docs/reference/who_ht_maxvel.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -116,7 +116,7 @@

    who_ht_maxvel_3sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/who_ht_maxvel_2sd.html b/docs/reference/who_ht_maxvel_2sd.html index fb6b1695..3dffac09 100644 --- a/docs/reference/who_ht_maxvel_2sd.html +++ b/docs/reference/who_ht_maxvel_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -116,7 +116,7 @@

    who_ht_maxvel_2sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/who_ht_vel_2sd.html b/docs/reference/who_ht_vel_2sd.html index f294bdd4..5b56410b 100644 --- a/docs/reference/who_ht_vel_2sd.html +++ b/docs/reference/who_ht_vel_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -116,7 +116,7 @@

    who_ht_vel_2sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/who_ht_vel_3sd.html b/docs/reference/who_ht_vel_3sd.html index 8fd6381c..ca497d3b 100644 --- a/docs/reference/who_ht_vel_3sd.html +++ b/docs/reference/who_ht_vel_3sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.1 + 2.0.2 @@ -116,7 +116,7 @@

    who_ht_vel_3sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 08d14f34..db0605b1 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -6,6 +6,9 @@ /LICENSE-text.html + + /LICENSE.html + /articles/adult-algorithm.html diff --git a/man/ext_bmiz.Rd b/man/ext_bmiz.Rd index b4e6615b..b31a1fcb 100644 --- a/man/ext_bmiz.Rd +++ b/man/ext_bmiz.Rd @@ -43,7 +43,9 @@ differ only for children who have a BMI > 95th percentile. } \details{ This function should produce output equivalent to the SAS macro provided at -https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm +https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm. The macro +was updated in December, 2022, and this function has been updated to match it +as of growthcleanr v2.1.0. The extended BMIz is the inverse cumulative distribution function (CDF) of the extended BMI percentile. If the extended percentile is very close to diff --git a/vignettes/utilities.Rmd b/vignettes/utilities.Rmd index 26b75af5..f286fdce 100644 --- a/vignettes/utilities.Rmd +++ b/vignettes/utilities.Rmd @@ -28,6 +28,9 @@ a BMI > 39, and it is likely that these BMIs represent data entry errors. For th cases, extended BMIz is set to 8.21, a value that is slightly greater than the largest value that can be calculated. +The CDC SAS macro was updated in December 2022, and `ext_bmiz()` has been +updated to match it as of growthcleanr v2.1.0. + ## Converting long growthcleanr data to wide format w/BMI Because `ext_bmiz()` performs cross-sectional analysis of BMI, observation data must be From 83d5804e96e188921e6c021c1f5b1d7ee2adb479 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Wed, 1 Feb 2023 17:26:13 -0500 Subject: [PATCH 45/67] Tweaking cdc.R formatting for consistency, update ext_bmiz() docs, vignette, closes #98 --- R/cdc.R | 20 +++++---- docs/articles/utilities.html | 80 +++++++++++++++++++++++------------- docs/pkgdown.yml | 2 +- vignettes/utilities.Rmd | 65 ++++++++++++++++++----------- 4 files changed, 106 insertions(+), 61 deletions(-) diff --git a/R/cdc.R b/R/cdc.R index 37a92a47..e169dd4b 100644 --- a/R/cdc.R +++ b/R/cdc.R @@ -28,9 +28,9 @@ set_cols_first <- function(DT, cols, intersection = TRUE) ))) } else { - return(setcolorder(DT, c(cols, setdiff(names( - DT - ), cols)))) + return(setcolorder(DT, c(cols, setdiff( + names(DT), cols + )))) } } @@ -169,14 +169,16 @@ ext_bmiz <- function (data, data <- data[between(age, 24, 240) & !(is.na(wt) & is.na(ht)), .(seq_, sexn, age, wt, ht, bmi)] v1 <- c("seq_", "id", "sexn", "age", "wt", "ht", "bmi") + dref_path <- ifelse( ref.data.path == "", - system.file("extdata/CDCref_d.csv.gz", - package = "growthcleanr"), - paste(ref.data.path, "CDCref_d.csv.gz", - sep = "") + system.file("extdata/CDCref_d.csv.gz", package = "growthcleanr"), + paste(ref.data.path, "CDCref_d.csv.gz", sep = "") ) + # Note: referring to underscore-leading column as `_AGEMOS1`, i.e. with + # backticks, results in a no visible binding warning, but vars can't start + # with an "_", so we have to use backticks at assignment up above as well. dref <- fread(dref_path)[`_AGEMOS1` > 23 & denom == "age"] names(dref) <- tolower(names(dref)) names(dref) <- gsub("^_", "", names(dref)) @@ -194,6 +196,7 @@ ext_bmiz <- function (data, mht2, sht2)] names(d20) <- gsub("2", "", names(d20)) + dref <- dref[, .(sexn, agemos1, lwt1, @@ -206,6 +209,7 @@ ext_bmiz <- function (data, mht1, sht1)] names(dref) <- gsub("1", "", names(dref)) + dref <- rbindlist(list(dref, d20)) adj_bmi_met <- dref[agemos == 240, .(sexn, mbmi, sbmi)] %>% setnames(., c("sexn", "mref", "sref")) @@ -231,6 +235,8 @@ ext_bmiz <- function (data, fapp <- function(vars, ...) approx(.d$age, vars, xout = uages)$y + # Note: specifying v with "..v" gives no visible binding warning, use + # with option data.frame(sapply(.d[, v, with = FALSE], fapp)) } dref <- rbindlist(lapply(1:2, fapprox)) diff --git a/docs/articles/utilities.html b/docs/articles/utilities.html index 264db5e8..12f13b61 100644 --- a/docs/articles/utilities.html +++ b/docs/articles/utilities.html @@ -271,20 +271,30 @@

    Computing BMI percentiles and Z- coded, ext_bmiz() can be called:

    cleaned_data_bmiz <- ext_bmiz(cleaned_data_bmi)
     head(cleaned_data_bmiz)
    -           id    agey     agem      bmi sex   wt     ht agedays      age     bmi_l    bmi_m      bmi_s         waz    mod_waz        haz    mod_haz     bmiz  mod_bmiz
    -1: 1000287994 10.0301 120.3612 22.84087   1 40.1 132.50    3661 120.3612 -2.767881 16.64016 0.12002409  1.09852664  0.8417277 -0.9597118 -0.9717678 1.757419 1.5409867
    -2: 1000287994 11.0466 132.5592 22.84087   1 40.1 132.50    4032 132.5592 -2.589785 17.20379 0.12676206  0.52509455  0.3595874 -1.6331550 -1.6408514 1.584028 1.2827508
    -3: 1000287994 12.0630 144.7560 18.35674   1 40.1 147.80    4403 144.7560 -2.444694 17.82828 0.13146572 -0.08603109 -0.1155501 -0.2209003 -0.2267003 0.214444 0.1132188
    -4: 1000287994 13.0795 156.9540 24.12048   1 57.8 154.80    4774 156.9540 -2.325379 18.49734 0.13420981  1.07298540  0.8792766 -0.2418916 -0.2436118 1.475755 1.1619424
    -5: 1000287994 14.0959 169.1508 25.03608   1 66.6 163.10    5145 169.1508 -2.222102 19.19533 0.13527053  1.24466369  1.0724802 -0.1772860 -0.1713432 1.483245 1.1877586
    -6: 1000287994  4.9479  59.3748 16.88341   1 19.5 107.47    1806  59.3748 -2.533423 15.43155 0.07546578  0.48691152  0.3858433 -0.2363398 -0.2340109 1.065532 0.8981828
    -       bmip      p95      p97    bmip95       wp       hp obese sev_obese ext_bmiz ext_bmip    sigma
    -1: 96.05768 22.14172 23.71268 103.15762 86.40127 16.86001     1         0 1.705525 95.59517 4.668954
    -2: 94.34063 23.21872 24.93200  98.37264 70.02413  5.12182     0         0 1.584028 94.34063 5.002164
    -3: 58.48996 24.25081 26.05464  75.69536 46.57209 41.25850     0         0 0.214444 58.48996 5.316539
    -4: 92.99952 25.21239 27.05537  95.66916 85.83612 40.44321     0         0 1.475755 92.99952 5.612141
    -5: 93.09953 26.09135 27.92776  95.95547 89.33723 42.96419     0         0 1.483245 93.09953 5.888911
    -6: 85.66823 17.91161 18.39937  94.25957 68.68395 40.65845     0         0 1.065532 85.66823 2.720945
    + subjid agey age sex wt wt_id ht ht_id agedays bmi bmiz + <char> <num> <num> <int> <num> <int> <num> <int> <int> <num> <num> +1: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 10.0233 120.2796 2 35.4 17 141.6 15 3661 17.65537 0.3236612 +2: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 11.0390 132.4680 2 39.2 19 147.9 18 4032 17.92048 0.1734315 +3: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 12.0548 144.6576 2 44.8 21 155.1 20 4403 18.62320 0.1832443 +4: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 12.5914 151.0968 2 47.8 23 158.7 22 4599 18.97903 0.1829183 +5: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 13.0705 156.8460 2 50.5 26 160.8 24 4774 19.53077 0.2586449 +6: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 3.9288 47.1456 2 16.6 2 102.6 1 1435 15.76933 0.3453978 + bmip waz wp haz hp p95 p97 bmip95 mod_bmiz mod_waz mod_haz + <num> <num> <num> <num> <num> <num> <num> <num> <num> <num> <num> +1: 62.69027 0.3498817 63.67862 0.5140553 69.63933 22.96109 24.57902 76.89254 0.18485501 0.2399201 0.5008944 +2: 56.88438 0.2311645 59.14065 0.5002225 69.15408 24.13836 25.90525 74.24067 0.09543668 0.1556259 0.4955022 +3: 57.26968 0.3237374 62.69316 0.4803298 68.45036 25.26981 27.17179 73.69745 0.10065274 0.2201655 0.4855100 +4: 57.25689 0.3812700 64.84986 0.5153244 69.68368 25.83904 27.80781 73.45100 0.10011666 0.2596479 0.5212281 +5: 60.20454 0.4440465 67.14955 0.4849566 68.61464 26.32757 28.35405 74.18371 0.14353771 0.3024342 0.4885546 +6: 63.51023 0.4369963 66.89430 0.5348018 70.36065 18.02950 18.60078 87.46409 0.24462581 0.3332011 0.5224816 + sigma original_bmip original_bmiz sev_obese obese + <num> <num> <num> <int> <int> +1: 4.443536 62.69027 0.3236612 0 0 +2: 4.797031 56.88438 0.1734315 0 0 +3: 5.148292 57.26968 0.1832443 0 0 +4: 5.332930 57.25689 0.1829183 0 0 +5: 5.497248 60.20454 0.2586449 0 0 +6: 2.274792 63.51023 0.3453978 0 0

    The output columns include:

    @@ -297,6 +307,14 @@

    Computing BMI percentiles and Z-

    + + + + + + + + @@ -305,31 +323,35 @@

    Computing BMI percentiles and Z-

    - - + + - - - - + + + + - + - - + + - - + + + + + +
    bmiBMI
    bmiz, bmipLMS / Extended z-score and percentile
    waz, wp LMS Weight-for-sex/age z-score and percentile
    LMS Height-for-sex/age z-score and percentile
    bmiz, bmipLMS BMI-for-sex/age z-score and percentilep95, p9795th and 97th percentile of BMI in growth charts
    mod_waz, mod_haz, mod_bmiModified z-scores for identifying outliers (see the information in -the CDC -SAS growth charts program website)
    bmip95 BMI expressed as a percentage of the 95th percentile. A value ≥ 120 is widely used as the cut point for severe obesity.
    mod_bmiz, mod_waz, mod_hazModified BMI-for-age, Weight-for-age, and Height-for-age z-scores +for identifying outliers (see the information in the CDC +SAS growth charts program website)
    sigmaScale parameter of the half-normal distributionScale parameter for half-normal distribution
    ext_bmipExtended BMI percentileoriginal_bmiz, original_bmipLMS BMI-for-sex/age z-score and percentile
    ext_bmizExtended BMI z-scoresev_obeseBMI >= 120% of 95th percentile (0/1)
    obeseBMI >= 95th percentile (0/1)
    @@ -368,7 +390,9 @@

    Details

    age should be coded in months, using the most precise values available. To convert to months from age in years, multiply by 12. To convert to months from age in days, divide by 30.4375 (365.25 / 12).

    -

    sex is coded as 1 (Male) or 2 (Female). Note that this is different -from cleangrowth, which uses 0 (Male) and 1 (Female).

    +

    sex is coded as 1, boys, Boys, b, B, males, Males, m, or M for male +subjects or 2, girls, Girls, g, G, females, Females, f, or F for female +subjects. Note that this is different from cleangrowth, which uses +0 (Male) and 1 (Female).

    wt should be in kilograms.

    ht should be in centimeters.

    Specify the input data parameter names for age, wt, diff --git a/man/ext_bmiz.Rd b/man/ext_bmiz.Rd index b31a1fcb..ec5593b8 100644 --- a/man/ext_bmiz.Rd +++ b/man/ext_bmiz.Rd @@ -65,8 +65,10 @@ generated by this function. To convert to months from age in years, multiply by 12. To convert to months from age in days, divide by 30.4375 (365.25 / 12). -\code{sex} is coded as 1 (Male) or 2 (Female). Note that this is different -from \code{cleangrowth}, which uses 0 (Male) and 1 (Female). +\code{sex} is coded as 1, boys, Boys, b, B, males, Males, m, or M for male +subjects or 2, girls, Girls, g, G, females, Females, f, or F for female +subjects. Note that this is different from \code{cleangrowth}, which uses +0 (Male) and 1 (Female). \code{wt} should be in kilograms. From d9c9d309b57f57d02a264eaaceaa178a6f50bda0 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Thu, 2 Feb 2023 15:27:15 -0500 Subject: [PATCH 47/67] Added explicit link to NCHS report in ext_bmiz() docs, refs #98 --- R/cdc.R | 5 +++-- vignettes/utilities.Rmd | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/R/cdc.R b/R/cdc.R index 65dadcb8..92e8be91 100644 --- a/R/cdc.R +++ b/R/cdc.R @@ -45,8 +45,9 @@ set_cols_first <- function(DT, cols, intersection = TRUE) #' #' This function should produce output equivalent to the SAS macro provided at #' https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm. The macro -#' was updated in December, 2022, and this function has been updated to match it -#' as of growthcleanr v2.1.0. +#' was updated in December, 2022, according to the findings of the NCHS +#' report available at https://dx.doi.org/10.15620/cdc:121711. This function has +#' been updated to match it as of growthcleanr v2.1.0. #' #' The extended BMIz is the inverse cumulative distribution function (CDF) of #' the extended BMI percentile. If the extended percentile is very close to diff --git a/vignettes/utilities.Rmd b/vignettes/utilities.Rmd index 7215dab3..a1d85168 100644 --- a/vignettes/utilities.Rmd +++ b/vignettes/utilities.Rmd @@ -17,19 +17,23 @@ for weight, height, and BMI. Note that for BMIs ≤ 95th percentile of the CDC growth charts, the extended values for BMI are equal to the LMS values. The extended values differ only for children who have a BMI > 95th percentile. -The function assumes a variable ‘sex’ (coded as 1=boys / 2=girls) and variables for age -in months, weight (kg), height (cm), and BMI (weight/ht2). Please be careful with age - -the units should be months and use the most accurate information available (e.g., -23.4928 months. The extended BMIz is the inverse cumulative distribution function (CDF) -of the extended BMI percentile. If the extended percentile is very close to 100, the -`qnorm` function in R produces an infinite value. The occurs only if the extended BMI -percentile is > 99.99999999999999. This occurs infrequently, such as a 48-month-old with -a BMI > 39, and it is likely that these BMIs represent data entry errors. For these -cases, extended BMIz is set to 8.21, a value that is slightly greater than the largest -value that can be calculated. - -The CDC SAS macro was updated in December 2022, and `ext_bmiz()` has been -updated to match it as of growthcleanr v2.1.0. +The function assumes a variable ‘sex’ (coded as any of '1', 'b', 'B', 'Boys', 'm', +'M', 'male', or 'Male' for male subjects and any of '2', 'g', 'G', 'Girls', 'f', +'F', 'female', or 'Female' for female subjects) and variables for age in months, weight (kg), +height (cm), and BMI (weight/ht2). Please be careful with age - the units should be +months and use the most accurate information available (e.g., 23.4928 months. The +extended BMIz is the inverse cumulative distribution function (CDF) of the extended +BMI percentile. If the extended percentile is very close to 100, the `qnorm` function +in R produces an infinite value. The occurs only if the extended BMI percentile +is > 99.99999999999999. This occurs infrequently, such as a 48-month-old with a BMI > 39, +and it is likely that these BMIs represent data entry errors. For these cases, extended +BMIz is set to 8.21, a value that is slightly greater than the largest value that can +be calculated. + +The CDC SAS macro was updated in December 2022, according to the findings of +[this NCHS report](https://dx.doi.org/10.15620/cdc:121711). The `ext_bmiz()` function +has been updated to match it as of growthcleanr v2.1.0. + ## Converting long growthcleanr data to wide format w/BMI From efb4d8074c41dc3374a84cb90ec11c521cf959dc Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Thu, 2 Feb 2023 15:52:41 -0500 Subject: [PATCH 48/67] Tweaked ext_bmiz() docs further for clarity, refs #98 --- docs/404.html | 12 +- docs/LICENSE-text.html | 13 +- docs/LICENSE.html | 23 +-- docs/articles/adult-algorithm.html | 24 +-- docs/articles/configuration.html | 24 +-- docs/articles/developer-guidelines.html | 4 +- docs/articles/index.html | 13 +- docs/articles/installation.html | 38 ++--- docs/articles/large-data-sets.html | 24 +-- docs/articles/next-steps.html | 24 +-- docs/articles/output.html | 24 +-- docs/articles/quickstart.html | 24 +-- docs/articles/usage.html | 24 +-- docs/articles/utilities.html | 68 +++++---- docs/authors.html | 45 +++--- docs/index.html | 12 +- docs/news/index.html | 13 +- docs/pkgdown.yml | 3 +- docs/reference/CDCref_d.html | 15 +- docs/reference/acf_answers.html | 25 ++- docs/reference/adjustcarryforward.html | 25 ++- docs/reference/bmianthro.html | 15 +- docs/reference/cleangrowth.html | 18 +-- docs/reference/ewma.html | 17 ++- docs/reference/ext_bmiz.html | 17 ++- docs/reference/growth_cdc_ext.html | 15 +- docs/reference/index.html | 13 +- docs/reference/lenanthro.html | 15 +- docs/reference/longwide.html | 72 ++++++--- docs/reference/nhanes-reference-medians.html | 15 +- docs/reference/read_anthro.html | 17 ++- docs/reference/recode_sex.html | 25 ++- docs/reference/sd_median.html | 17 ++- docs/reference/simple_bmi.html | 17 ++- docs/reference/splitinput.html | 17 ++- docs/reference/syngrowth.html | 15 +- docs/reference/tanner_ht_vel.html | 15 +- docs/reference/tanner_ht_vel_with_2sd.html | 15 +- .../test_syngrowth_sas_output_compare.html | 15 +- docs/reference/test_syngrowth_wide.html | 15 +- docs/reference/testacf.html | 15 +- docs/reference/weianthro.html | 15 +- docs/reference/who_ht_maxvel.html | 15 +- docs/reference/who_ht_maxvel_2sd.html | 15 +- docs/reference/who_ht_vel_2sd.html | 15 +- docs/reference/who_ht_vel_3sd.html | 15 +- docs/sitemap.xml | 2 +- vignettes/utilities.Rmd | 144 +++++++++--------- 48 files changed, 557 insertions(+), 521 deletions(-) diff --git a/docs/404.html b/docs/404.html index 836e0179..655306fb 100644 --- a/docs/404.html +++ b/docs/404.html @@ -18,7 +18,7 @@ - +

    - +
    @@ -139,10 +139,10 @@

    Page not found (404)

    + - - + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 3f61f7cc..6641b2f6 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -111,9 +111,10 @@

    License

    + - - + + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 2242508c..d4361a49 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -106,26 +106,19 @@

    MIT License

    - -
    -

    Site built with pkgdown 2.0.7.

    -=======

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    -

    Site built with pkgdown 2.0.6.

    ->>>>>>> remotes/github-carrie/upd-v2 +

    Site built with pkgdown 2.0.7.

    + - - + + diff --git a/docs/articles/adult-algorithm.html b/docs/articles/adult-algorithm.html index 0ee36b90..8ec13b75 100644 --- a/docs/articles/adult-algorithm.html +++ b/docs/articles/adult-algorithm.html @@ -19,7 +19,7 @@ - +
    - +
    - - + +

    There will be notes in italics throughout the introductory material discussing similarities and differences between growthcleanr-adults and growthcleanr-pediatrics for those who are @@ -835,7 +835,7 @@

    14H, 14W, Error load: Too-Many-Errors<
    @@ -846,10 +846,10 @@

    14H, 14W, Error load: Too-Many-Errors<

    + - - + diff --git a/docs/articles/configuration.html b/docs/articles/configuration.html index 92e61147..ae1d64ab 100644 --- a/docs/articles/configuration.html +++ b/docs/articles/configuration.html @@ -19,7 +19,7 @@ - +
    - +
    - - + +

    growthcleanr offers several options for configuration, with default values set to address common cases. You may wish to experiment with the settings to discover which work best for your @@ -363,7 +363,7 @@

    Derivation process

    -

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego, De los Santos Hannah.

    +

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    diff --git a/docs/articles/index.html b/docs/articles/index.html index 34f9b40e..2c48c47c 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -131,9 +131,10 @@

    Advanced

    + - - + + diff --git a/docs/articles/installation.html b/docs/articles/installation.html index e6c75e85..81469220 100644 --- a/docs/articles/installation.html +++ b/docs/articles/installation.html @@ -19,7 +19,7 @@ - +
    - +
    - - + +

    growthcleanr has been developed and tested using R versions 3.6 and 4+. It should work using R on Windows, macOS, or Unix/Linux, although there are some additional platform-specific notes you may wish to review.

    @@ -208,7 +208,7 @@

    Docker

    To install and run growthcleanr using Docker, open the PowerShell on Windows, or open the Terminal on macOS, and enter this docker command:

    -
    % docker run -it ghcr.io/mitre/growthcleanr/gcr-image:latest R
    +
    % docker run -it ghcr.io/mitre/growthcleanr/gcr-image:latest R

    The image tag latest in the example above will refer to the latest version of the package available on the main branch of the mitre/growthcleanr repository, which is typically in close sync with the upstream carriedaymont/growthcleanr @@ -216,7 +216,7 @@

    Docker growthcleanr. To explicitly choose a release by name, replace latest with the release tag, e.g. for the released package v2.1.0:

    -
    % docker run -it ghcr.io/mitre/growthcleanr/gcr-image:v2.1.0 R
    +
    % docker run -it ghcr.io/mitre/growthcleanr/gcr-image:v2.1.0 R

    Whichever package you use, the first time this command is run, it might take a few minutes to download and extract several necessary components, but this should be fully automated. If successful, you @@ -228,8 +228,8 @@

    Docker your own data. For example, if you are on Windows, and your data is in C:\Users\exampleuser\analysis, specify a mapping using the added -v step below:

    -
    % docker run -it -v C:\Users\exampleusers\analysis:/usr/src/app \
    -    ghcr.io/mitre/growthcleanr/gcr-image:latest R
    +
    % docker run -it -v C:\Users\exampleusers\analysis:/usr/src/app \
    +    ghcr.io/mitre/growthcleanr/gcr-image:latest R

    Note that the slashes in file paths reverse direction from the reference to the folder location on your Windows machine (before the colon) to the folder location on the Docker container (after the colon); @@ -242,8 +242,8 @@

    Docker

    If you are on macOS, and your data is in /Users/exampleuser/analysis, specify a folder mapping like this:

    -
    % docker run -it -v /Users/exampleuser/analysis:/usr/src/app \
    -    ghcr.io/mitre/growthcleanr/gcr-image:latest R
    +
    % docker run -it -v /Users/exampleuser/analysis:/usr/src/app \
    +    ghcr.io/mitre/growthcleanr/gcr-image:latest R

    If you mapped a folder, then inside the Docker environment’s R prompt, when you then issue a command like list.files(), you should see a list of the same files in the R session that you see in @@ -283,7 +283,7 @@

    If you are developing the growthcleanr code itself, you can download or clone the growthcleanr source code and then install it from source. To clone the source using git:

    -
    % git clone https://github.com/carriedaymont/growthcleanr.git
    +
    % git clone https://github.com/carriedaymont/growthcleanr.git

    Once you have the growthcleanr package source, open an R session from the growthcleanr base directory. Then install growthcleanr using the R devtools package:

    @@ -304,7 +304,7 @@

    @@ -315,10 +315,10 @@

    + - - + diff --git a/docs/articles/large-data-sets.html b/docs/articles/large-data-sets.html index e67a1933..3ee70846 100644 --- a/docs/articles/large-data-sets.html +++ b/docs/articles/large-data-sets.html @@ -19,7 +19,7 @@ - +
    - +
    - - + +

    The nature of the growthcleanr algorithm is repetitive. It runs many checks over each individual subject’s measurements, in a specific sequence, and revises its assessments as it goes. Because of @@ -331,7 +331,7 @@

    Reference for gcdriver.R + - - + diff --git a/docs/articles/next-steps.html b/docs/articles/next-steps.html index 8522e442..e5222953 100644 --- a/docs/articles/next-steps.html +++ b/docs/articles/next-steps.html @@ -19,7 +19,7 @@ - +
    - +
    - - + +

    While both the pediatric and adult algorithms are considered complete, we have identified several areas for additional research and potential enhancement.

    @@ -514,7 +514,7 @@

    Error load

    -

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego, De los Santos Hannah.

    +

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    @@ -525,10 +525,10 @@

    Error load - +
    - +
    - - + +

    As seen in the Usage example, growthcleanr creates a vector of flags identifying which measurements should be included or excluded, and why. This vector can be @@ -544,7 +544,7 @@

    Exclusions generated by adult a
    @@ -555,10 +555,10 @@

    Exclusions generated by adult a

    + - - + diff --git a/docs/articles/quickstart.html b/docs/articles/quickstart.html index f9fe6175..ad5f8775 100644 --- a/docs/articles/quickstart.html +++ b/docs/articles/quickstart.html @@ -19,7 +19,7 @@ - +
    - +
    - - + +

    R setup

    @@ -480,7 +480,7 @@

    Example + - - + diff --git a/docs/articles/usage.html b/docs/articles/usage.html index 8e00498f..1a5942c3 100644 --- a/docs/articles/usage.html +++ b/docs/articles/usage.html @@ -19,7 +19,7 @@ - +
    - +
    - - + +

    With the growthcleanr package installed as described in Installation, it can be loaded as a package:

    @@ -301,7 +301,7 @@

    Basic configuration options

    -

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego, De los Santos Hannah.

    +

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    @@ -312,10 +312,10 @@

    Basic configuration options - +
    - +
    - - + +

    The CDC provides a SAS macro for computing BMI percentiles and Z-scores. The function ext_bmiz(), included in growthcleanr, provides @@ -132,8 +132,8 @@

    2023-02-01

    and BMI. Note that for BMIs ≤ 95th percentile of the CDC growth charts, the extended values for BMI are equal to the LMS values. The extended values differ only for children who have a BMI > 95th percentile.

    -

    The function assumes a variable ‘sex’ (coded as 1=boys / 2=girls) and -variables for age in months, weight (kg), height (cm), and BMI +

    The function assumes a variable ‘sex’

    +

    and variables for age in months, weight (kg), height (cm), and BMI (weight/ht2). Please be careful with age - the units should be months and use the most accurate information available (e.g., 23.4928 months. The extended BMIz is the inverse cumulative distribution function (CDF) @@ -144,9 +144,10 @@

    2023-02-01

    a BMI > 39, and it is likely that these BMIs represent data entry errors. For these cases, extended BMIz is set to 8.21, a value that is slightly greater than the largest value that can be calculated.

    -

    The CDC SAS macro was updated in December 2022, and -ext_bmiz() has been updated to match it as of growthcleanr -v2.1.0.

    +

    The CDC SAS macro was updated in December 2022, according to the +findings of this NCHS +report. The ext_bmiz() function has been updated to +match it as of growthcleanr v2.1.0.

    Converting long growthcleanr data to wide format w/BMI

    @@ -240,18 +241,20 @@

    Converting long g

    Recoding sex values

    -

    Note that ext_bmiz() expects the sex -variable to be coded as a numeric value of 1 (male) or -2 (female). This difference from the +

    Note that ext_bmiz() allows for the sex +variable to be coded using a range of possible +values, but not the same 0 and 1 values as +cleangrowth(). This difference from the growthcleanr data preparation specification sustains compatibility with the CDC SAS macro. The -longwide() function will handle this conversion given the -expected input values of 0 (male) or 1 -(female).

    -

    If you are using different input data for ext_bmiz(), -ensure the sex variable in your data set is properly coded. -To do so, use recode_sex(). For example, if you have data -in the PCORnet CDM format, and want to prepare it for +longwide() function will handle this conversion from +growthcleanr’s 0 (male) or 1 +(female), but not from other coded values.

    +

    If you are using input data with different value codes for +sex with ext_bmiz(), use +recode_sex() to ensure your values are recoded first. For +example, if you have data in the PCORnet CDM format (using +M and F), and want to prepare it for ext_bmiz():

     recode_sex(
    @@ -270,8 +273,11 @@ 

    Recoding sex values

    Computing BMI percentiles and Z-scores

    -

    With data in wide format with BMI, and with sex variables properly -coded, ext_bmiz() can be called:

    +

    With data in wide format with BMI, and with sex values +properly coded (as any of ‘1’, ‘b’, ‘B’, ‘Boys’, ‘m’, ‘M’, ‘male’, or +‘Male’ for male subjects and any of ‘2’, ‘g’, ‘G’, ‘Girls’, ‘f’, ‘F’, +‘female’, or ‘Female’ for female subjects), ext_bmiz() can +be called:

    cleaned_data_bmiz <- ext_bmiz(cleaned_data_bmi)
     head(cleaned_data_bmiz)
                                      subjid    agey      age   sex    wt wt_id    ht ht_id agedays      bmi      bmiz
    @@ -301,8 +307,8 @@ 

    Computing BMI percentiles and Z-

    The output columns include:

    --++ @@ -416,7 +422,7 @@

    Citation

    + - - + + diff --git a/docs/index.html b/docs/index.html index 983af290..9fb39e67 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,7 +20,7 @@ - +
    - +
    @@ -241,10 +241,10 @@

    Dev status

    + - - + diff --git a/docs/news/index.html b/docs/news/index.html index 213a855f..f474ffc5 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -305,9 +305,10 @@

    Added - +

    - +
    @@ -96,7 +96,7 @@

    CDC BMI reference data

    CDCref_d.csv.gz

    - +

    Used for extended BMI computation

    @@ -119,9 +119,10 @@

    CDCref_d.csv.gz

    + - - + + diff --git a/docs/reference/acf_answers.html b/docs/reference/acf_answers.html index a9d4c8ef..fe64c5c8 100644 --- a/docs/reference/acf_answers.html +++ b/docs/reference/acf_answers.html @@ -4,7 +4,7 @@ - +
    - +
    @@ -166,7 +166,7 @@

    Arguments

    Value

    - +

    A data frame, containing an index "n" of rows, corresponding to the original order of the input vectors, and "acf_answers", containing the answers @@ -183,26 +183,19 @@

    Value

    - -
    -

    Site built with pkgdown 2.0.7.

    -=======

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    -

    Site built with pkgdown 2.0.6.

    ->>>>>>> remotes/github-carrie/upd-v2 +

    Site built with pkgdown 2.0.7.

    + - - + + diff --git a/docs/reference/adjustcarryforward.html b/docs/reference/adjustcarryforward.html index e12bc602..8f011ed4 100644 --- a/docs/reference/adjustcarryforward.html +++ b/docs/reference/adjustcarryforward.html @@ -9,7 +9,7 @@ - +
    - +
    @@ -233,7 +233,7 @@

    Arguments

    Value

    - +

    Re-evaluated exclusion assessments based on height velocity.

    @@ -267,26 +267,19 @@

    Examples

    - -
    -

    Site built with pkgdown 2.0.7.

    -=======

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    -

    Site built with pkgdown 2.0.6.

    ->>>>>>> remotes/github-carrie/upd-v2 +

    Site built with pkgdown 2.0.7.

    + - - + + diff --git a/docs/reference/bmianthro.html b/docs/reference/bmianthro.html index 75a15ced..2111b1b2 100644 --- a/docs/reference/bmianthro.html +++ b/docs/reference/bmianthro.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -100,7 +100,7 @@

    Details

    bmianthro.txt.gz

    - +

    Used in function cleangrowth()

    @@ -123,9 +123,10 @@

    bmianthro.txt.gz

    + - - + + diff --git a/docs/reference/cleangrowth.html b/docs/reference/cleangrowth.html index 83792b9f..f0d69df5 100644 --- a/docs/reference/cleangrowth.html +++ b/docs/reference/cleangrowth.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -276,7 +276,7 @@

    Arguments

    Value

    - +

    Vector of exclusion codes for each of the input measurements.

    @@ -315,7 +315,6 @@

    Examples

    measurement = df_stats$measurement, parallel = TRUE, num.batches = 2) - #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’ #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’ #> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’ @@ -331,7 +330,7 @@

    Examples

    @@ -340,9 +339,10 @@

    Examples

    + - - + + diff --git a/docs/reference/ewma.html b/docs/reference/ewma.html index 4f1011e5..7cd2d79f 100644 --- a/docs/reference/ewma.html +++ b/docs/reference/ewma.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -117,7 +117,7 @@

    Arguments

    Value

    - +

    Data frame with 3 variables:

    • The first variable (ewma.all) contains the EWMA at observation time excluding only the actual observation for that time point.

    • @@ -154,7 +154,7 @@

      Examples

      @@ -163,9 +163,10 @@

      Examples

    + - - + + diff --git a/docs/reference/ext_bmiz.html b/docs/reference/ext_bmiz.html index 9b9fe319..f0ccf91d 100644 --- a/docs/reference/ext_bmiz.html +++ b/docs/reference/ext_bmiz.html @@ -8,7 +8,7 @@ - +
    - +
    @@ -148,7 +148,7 @@

    Arguments

    Value

    - +

    Expanded data frame containing computed BMI values

    @@ -226,7 +226,7 @@

    Examples

    @@ -235,9 +235,10 @@

    Examples

    + - - + + diff --git a/docs/reference/growth_cdc_ext.html b/docs/reference/growth_cdc_ext.html index 29f6d36f..bc28bd86 100644 --- a/docs/reference/growth_cdc_ext.html +++ b/docs/reference/growth_cdc_ext.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -100,7 +100,7 @@

    Details

    growthfile_cdc_ext.csv.gz

    - +

    Used in function cleangrowth()

    @@ -123,9 +123,10 @@

    growthfile_cdc_ext.csv.gz

    + - - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 1f491835..660c70e0 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -3,7 +3,7 @@ - +
    - + - +
    @@ -100,7 +100,7 @@

    Details

    lenanthro.txt.gz

    - +

    Used in function cleangrowth()

    @@ -123,9 +123,10 @@

    lenanthro.txt.gz

    + - - + + diff --git a/docs/reference/longwide.html b/docs/reference/longwide.html index 45f58624..3b549153 100644 --- a/docs/reference/longwide.html +++ b/docs/reference/longwide.html @@ -1,9 +1,11 @@ -Transform data in growthcleanr format into wide structure for BMI calculation — longwide • growthcleanrTransform data in growthcleanr format into wide structure for BMI calculation — longwide • growthcleanr - +
    - +
    @@ -90,7 +92,9 @@

    Transform data in growthcleanr format into wide structure for BMI calculatio

    -

    longwide transforms data from long to wide format. Ideal for transforming output from growthcleanr::cleangrowth() into a format suitable for growthcleanr::ext_bmiz().

    +

    longwide transforms data from long to wide format. Ideal for +transforming output from growthcleanr::cleangrowth() into a format suitable +for growthcleanr::ext_bmiz().

    @@ -104,14 +108,17 @@

    Transform data in growthcleanr format into wide structure for BMI calculatio measurement = "measurement", gcr_result = "gcr_result", include_all = FALSE, - inclusion_types = c("Include") + inclusion_types = c("Include"), + extra_cols = NULL, + keep_unmatched_data = FALSE )

    Arguments

    long_df
    -

    A data frame to be transformed. Expects columns: id, subjid, sex, agedays, param, measurement, and gcr_result.

    +

    A data frame to be transformed. Expects columns: id, subjid, +sex, agedays, param, measurement, and gcr_result.

    id
    @@ -135,7 +142,8 @@

    Arguments

    measurement
    -

    name of measurement column containing the actual measurement data

    +

    name of measurement column containing the actual +measurement data

    gcr_result
    @@ -143,18 +151,41 @@

    Arguments

    include_all
    -

    Determines whether the function keeps all exclusion codes. If TRUE, all exclusion types are kept and the inclusion_types argument is ignored. Defaults to FALSE.

    +

    Determines whether the function keeps all exclusion codes. +If TRUE, all exclusion types are kept and the inclusion_types argument is +ignored. Defaults to FALSE.

    inclusion_types
    -

    Vector indicating which exclusion codes from the cleaning algorithm should be included in the data, given that include_all is FALSE. For all options, see growthcleanr::cleangrowth(). Defaults to c("Include").

    +

    Vector indicating which exclusion codes from the +cleaning algorithm should be included in the data, given that include_all is +FALSE. For all options, see growthcleanr::cleangrowth(). Defaults to +c("Include").

    + + +
    extra_cols
    +

    Vector of additional columns to include in the output. If +a column C1 differs on agedays matched height and weight values, then include +separate ht_C1 and wt_C1 columns as well as a match_C1 column that gives +booleans indicating where ht_C1 and wt_C1 are the same. If the agedays +matched height and weight columns are identical, then only include a single +version of C1. Defaults to empty vector (not keeping any additional columns).

    + + +
    keep_unmatched_data
    +

    boolean indicating whether to keep height/weight +observations that do not have a matching weight/height on that day

    Value

    + - -

    Returns a data frame transformed from long to wide. Includes only values flagged with indicated inclusion types. Note that, for each subject, heights without corresponding weights for a given age (and vice versa) will be dropped.

    +

    Returns a data frame transformed from long to wide. Includes only +values flagged with indicated inclusion types. Potentially includes +additional columns if arguments are passed to extra_cols. For each subject, +heights without corresponding weights for a given age (and vice versa) will +be dropped unless keep_unmatched_data is set to TRUE.

    @@ -186,26 +217,19 @@

    Examples

    - -
    -

    Site built with pkgdown 2.0.7.

    -=======

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    -

    Site built with pkgdown 2.0.6.

    ->>>>>>> remotes/github-carrie/upd-v2 +

    Site built with pkgdown 2.0.7.

    + - - + + diff --git a/docs/reference/nhanes-reference-medians.html b/docs/reference/nhanes-reference-medians.html index b5d299a9..a24361e2 100644 --- a/docs/reference/nhanes-reference-medians.html +++ b/docs/reference/nhanes-reference-medians.html @@ -4,7 +4,7 @@ - +
    - +
    @@ -98,7 +98,7 @@

    NHANES reference medians

    nhanes-reference-medians.csv.gz

    - +

    Used in function cleangrowth()

    @@ -121,9 +121,10 @@

    nhanes-reference-medians.csv.gz

    + - - + + diff --git a/docs/reference/read_anthro.html b/docs/reference/read_anthro.html index 58f892bc..d6d8b703 100644 --- a/docs/reference/read_anthro.html +++ b/docs/reference/read_anthro.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -109,7 +109,7 @@

    Arguments

    Value

    - +

    Function for calculating BMI based on measurement, age in days, sex, and measurement value.

    @@ -132,7 +132,7 @@

    Examples

    @@ -141,9 +141,10 @@

    Examples

    + - - + + diff --git a/docs/reference/recode_sex.html b/docs/reference/recode_sex.html index d1c21440..7bff85a6 100644 --- a/docs/reference/recode_sex.html +++ b/docs/reference/recode_sex.html @@ -4,7 +4,7 @@ - +
    - +
    @@ -139,7 +139,7 @@

    Arguments

    Value

    - +

    Returns a data table with recoded sex variables.

    @@ -167,26 +167,19 @@

    Examples

    - -
    -

    Site built with pkgdown 2.0.7.

    -=======

    Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

    -

    Site built with pkgdown 2.0.6.

    ->>>>>>> remotes/github-carrie/upd-v2 +

    Site built with pkgdown 2.0.7.

    + - - + + diff --git a/docs/reference/sd_median.html b/docs/reference/sd_median.html index de4b564e..58b49289 100644 --- a/docs/reference/sd_median.html +++ b/docs/reference/sd_median.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -117,7 +117,7 @@

    Arguments

    Value

    - +

    Table of data with median SD-scores per day of life by gender and parameter.

    @@ -151,7 +151,7 @@

    Examples

    @@ -160,9 +160,10 @@

    Examples

    + - - + + diff --git a/docs/reference/simple_bmi.html b/docs/reference/simple_bmi.html index 47f267f4..f43d4c1e 100644 --- a/docs/reference/simple_bmi.html +++ b/docs/reference/simple_bmi.html @@ -4,7 +4,7 @@ - +
    - +
    @@ -116,7 +116,7 @@

    Arguments

    Value

    - +

    Returns a data table with the added column "bmi"

    @@ -151,7 +151,7 @@

    Examples

    @@ -160,9 +160,10 @@

    Examples

    + - - + + diff --git a/docs/reference/splitinput.html b/docs/reference/splitinput.html index cd00e47f..ba060881 100644 --- a/docs/reference/splitinput.html +++ b/docs/reference/splitinput.html @@ -7,7 +7,7 @@ - +
    - +
    @@ -135,7 +135,7 @@

    Arguments

    Value

    - +

    the count number referring to the last split file written

    @@ -169,7 +169,7 @@

    Examples

    @@ -178,9 +178,10 @@

    Examples

    + - - + + diff --git a/docs/reference/syngrowth.html b/docs/reference/syngrowth.html index fcafd15f..b0192f30 100644 --- a/docs/reference/syngrowth.html +++ b/docs/reference/syngrowth.html @@ -5,7 +5,7 @@ - +
    - +
    @@ -119,7 +119,7 @@

    Details

    @@ -128,9 +128,10 @@

    Details

    + - - + + diff --git a/docs/reference/tanner_ht_vel.html b/docs/reference/tanner_ht_vel.html index 13fba35e..8241a7ce 100644 --- a/docs/reference/tanner_ht_vel.html +++ b/docs/reference/tanner_ht_vel.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -100,7 +100,7 @@

    Details

    tanner_ht_vel.csv.gz

    - +

    Used in function cleangrowth()

    @@ -123,9 +123,10 @@

    tanner_ht_vel.csv.gz

    + - - + + diff --git a/docs/reference/tanner_ht_vel_with_2sd.html b/docs/reference/tanner_ht_vel_with_2sd.html index 192363a7..0b75daab 100644 --- a/docs/reference/tanner_ht_vel_with_2sd.html +++ b/docs/reference/tanner_ht_vel_with_2sd.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -101,7 +101,7 @@

    Details

    tanner_ht_vel_with_2sd.csv.gz

    - +

    Used in function acf_answers()

    @@ -124,9 +124,10 @@

    tanner_ht_vel_with_2sd.csv.gz

    + - - + + diff --git a/docs/reference/test_syngrowth_sas_output_compare.html b/docs/reference/test_syngrowth_sas_output_compare.html index 1ef7abae..5ad59501 100644 --- a/docs/reference/test_syngrowth_sas_output_compare.html +++ b/docs/reference/test_syngrowth_sas_output_compare.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -96,7 +96,7 @@

    CDC SAS BMI Output

    test_syngrowth_sas_output_compare.csv.gz

    - +

    Used to test function ext_bmiz()

    @@ -119,9 +119,10 @@

    test_syngrowth_sas_output_compare.csv.gz

    + - - + + diff --git a/docs/reference/test_syngrowth_wide.html b/docs/reference/test_syngrowth_wide.html index f1e5eccd..06cfffe8 100644 --- a/docs/reference/test_syngrowth_wide.html +++ b/docs/reference/test_syngrowth_wide.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -96,7 +96,7 @@

    CDC SAS BMI Input

    test_syngrowth_wide.csv.gz

    - +

    Used to test function ext_bmiz()

    @@ -119,9 +119,10 @@

    test_syngrowth_wide.csv.gz

    + - - + + diff --git a/docs/reference/testacf.html b/docs/reference/testacf.html index b4cb2e48..c43bc333 100644 --- a/docs/reference/testacf.html +++ b/docs/reference/testacf.html @@ -6,7 +6,7 @@ - +
    - +
    @@ -170,7 +170,7 @@

    Arguments

    Value

    - +

    A list containing: testacf_res: data frame with adjustcarryforward results for each run, @@ -195,9 +195,10 @@

    Value

    + - - + + diff --git a/docs/reference/weianthro.html b/docs/reference/weianthro.html index 130329a3..6c097bd6 100644 --- a/docs/reference/weianthro.html +++ b/docs/reference/weianthro.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -100,7 +100,7 @@

    Details

    weianthro.csv.gz

    - +

    Used in function cleangrowth()

    @@ -123,9 +123,10 @@

    weianthro.csv.gz

    + - - + + diff --git a/docs/reference/who_ht_maxvel.html b/docs/reference/who_ht_maxvel.html index c8f5c6ad..a512ff04 100644 --- a/docs/reference/who_ht_maxvel.html +++ b/docs/reference/who_ht_maxvel.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -101,7 +101,7 @@

    Details

    who_ht_maxvel_3sd.csv.gz

    - +

    Used in function cleangrowth()

    @@ -124,9 +124,10 @@

    who_ht_maxvel_3sd.csv.gz

    + - - + + diff --git a/docs/reference/who_ht_maxvel_2sd.html b/docs/reference/who_ht_maxvel_2sd.html index 686f4956..b88f1e09 100644 --- a/docs/reference/who_ht_maxvel_2sd.html +++ b/docs/reference/who_ht_maxvel_2sd.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -101,7 +101,7 @@

    Details

    who_ht_maxvel_2sd.csv.gz

    - +

    Used in function acf_answers()

    @@ -124,9 +124,10 @@

    who_ht_maxvel_2sd.csv.gz

    + - - + + diff --git a/docs/reference/who_ht_vel_2sd.html b/docs/reference/who_ht_vel_2sd.html index cb07f7db..936d77e2 100644 --- a/docs/reference/who_ht_vel_2sd.html +++ b/docs/reference/who_ht_vel_2sd.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -101,7 +101,7 @@

    Details

    who_ht_vel_2sd.csv.gz

    - +

    Used in function acf_answers()

    @@ -124,9 +124,10 @@

    who_ht_vel_2sd.csv.gz

    + - - + + diff --git a/docs/reference/who_ht_vel_3sd.html b/docs/reference/who_ht_vel_3sd.html index ec59fb37..bf5ff208 100644 --- a/docs/reference/who_ht_vel_3sd.html +++ b/docs/reference/who_ht_vel_3sd.html @@ -3,7 +3,7 @@ - +
    - +
    @@ -101,7 +101,7 @@

    Details

    who_ht_vel_3sd.csv.gz

    - +

    Used in function cleangrowth()

    @@ -124,9 +124,10 @@

    who_ht_vel_3sd.csv.gz

    + - - + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index a6e2a931..f6ccaf70 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -138,4 +138,4 @@ /reference/who_ht_vel_3sd.html - \ No newline at end of file + diff --git a/vignettes/utilities.Rmd b/vignettes/utilities.Rmd index a1d85168..37788b98 100644 --- a/vignettes/utilities.Rmd +++ b/vignettes/utilities.Rmd @@ -7,7 +7,6 @@ vignette: > %\usepackage[utf8]{inputenc} --- - The CDC provides a [SAS macro for computing BMI percentiles and Z-scores](https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm). The function `ext_bmiz()`, included in `growthcleanr`, provides an equivalent @@ -17,37 +16,38 @@ for weight, height, and BMI. Note that for BMIs ≤ 95th percentile of the CDC growth charts, the extended values for BMI are equal to the LMS values. The extended values differ only for children who have a BMI > 95th percentile. -The function assumes a variable ‘sex’ (coded as any of '1', 'b', 'B', 'Boys', 'm', -'M', 'male', or 'Male' for male subjects and any of '2', 'g', 'G', 'Girls', 'f', -'F', 'female', or 'Female' for female subjects) and variables for age in months, weight (kg), -height (cm), and BMI (weight/ht2). Please be careful with age - the units should be -months and use the most accurate information available (e.g., 23.4928 months. The -extended BMIz is the inverse cumulative distribution function (CDF) of the extended -BMI percentile. If the extended percentile is very close to 100, the `qnorm` function -in R produces an infinite value. The occurs only if the extended BMI percentile -is > 99.99999999999999. This occurs infrequently, such as a 48-month-old with a BMI > 39, -and it is likely that these BMIs represent data entry errors. For these cases, extended -BMIz is set to 8.21, a value that is slightly greater than the largest value that can -be calculated. +The function assumes a variable ‘sex’ -The CDC SAS macro was updated in December 2022, according to the findings of -[this NCHS report](https://dx.doi.org/10.15620/cdc:121711). The `ext_bmiz()` function -has been updated to match it as of growthcleanr v2.1.0. +and variables for age in months, weight (kg), height (cm), and BMI (weight/ht2). +Please be careful with age - the units should be months and use the most +accurate information available (e.g., 23.4928 months. The extended BMIz is the +inverse cumulative distribution function (CDF) of the extended BMI percentile. +If the extended percentile is very close to 100, the `qnorm` function in R +produces an infinite value. The occurs only if the extended BMI percentile is > +99.99999999999999. This occurs infrequently, such as a 48-month-old with a BMI > +39, and it is likely that these BMIs represent data entry errors. For these +cases, extended BMIz is set to 8.21, a value that is slightly greater than the +largest value that can be calculated. +The CDC SAS macro was updated in December 2022, according to the findings of +[this NCHS report](https://dx.doi.org/10.15620/cdc:121711). The `ext_bmiz()` +function has been updated to match it as of growthcleanr v2.1.0. ## Converting long growthcleanr data to wide format w/BMI -Because `ext_bmiz()` performs cross-sectional analysis of BMI, observation data must be -in a wide format, i.e. with height and weight information on the same row. This is -distinct from `cleangrowth()`, which performs longitudinal analysis on all observations -for each subject, presented in a long format with one observation per row. To facilitate -use of both functions, `growthcleanr` includes utility functions to transform data used -with `cleangrowth()` for use with `ext_bmiz()`. They are optimized to move data directly -from the output of `cleangrowth()` into input for `ext_bmiz()`, but have options to -support independent use as well. +Because `ext_bmiz()` performs cross-sectional analysis of BMI, observation data +must be in a wide format, i.e. with height and weight information on the same +row. This is distinct from `cleangrowth()`, which performs longitudinal analysis +on all observations for each subject, presented in a long format with one +observation per row. To facilitate use of both functions, `growthcleanr` +includes utility functions to transform data used with `cleangrowth()` for use +with `ext_bmiz()`. They are optimized to move data directly from the output of +`cleangrowth()` into input for `ext_bmiz()`, but have options to support +independent use as well. -Using the `syngrowth` example dataset, to convert the data after it has been cleaned by -`cleangrowth()` for use with `ext_bmiz()`, use `longwide()` and `simple_bmi()`: +Using the `syngrowth` example dataset, to convert the data after it has been +cleaned by `cleangrowth()` for use with `ext_bmiz()`, use `longwide()` and +`simple_bmi()`: ```{r, eval = FALSE} # Use the built-in utility function to convert the input observations to wide @@ -69,10 +69,10 @@ names(cleaned_data) [1] "id" "subjid" "sex" "agedays" "param" "measurement" "gcr_result" ``` -The wide dataset `cleaned_data_wide` will include rows with aligned height and weight -measurements drawn from the observations in `cleaned_data` marked by `cleangrowth()` for -inclusion. As such, it will be a shorter dataset (fewer rows) based on fewer -observations. +The wide dataset `cleaned_data_wide` will include rows with aligned height and +weight measurements drawn from the observations in `cleaned_data` marked by +`cleangrowth()` for inclusion. As such, it will be a shorter dataset (fewer +rows) based on fewer observations. ```{r, eval = FALSE} dim(cleaned_data) @@ -91,13 +91,13 @@ head(cleaned_data_wide) 6 002986c5-354d-bb9d-c180-4ce26813ca28 60.1594 721.9128 2 69.4 83343 151.1 83342 21973.22 ``` -In this example, the subject identifiers previously marked as `subjid` are now in the -`id` column; individual identifiers for observations of a single parameter are not -present. +In this example, the subject identifiers previously marked as `subjid` are now +in the `id` column; individual identifiers for observations of a single +parameter are not present. -`longwide()` can be called with name mapping parameters if your input set uses different -column names. For example, if `my_cleaned_data` specifies age in days as `aged` and -parameter type as `type`, specify each, with quotes: +`longwide()` can be called with name mapping parameters if your input set uses +different column names. For example, if `my_cleaned_data` specifies age in days +as `aged` and parameter type as `type`, specify each, with quotes: ```{r, eval = FALSE} head(my_cleaned_data) @@ -135,16 +135,19 @@ formatted data frame directly to `ext_bmiz()`. ## Recoding sex values -Note that `ext_bmiz()` expects the `sex` variable to be coded as a numeric value -of `1` (male) or `2` (female). This difference from the `growthcleanr` [data -preparation specification](quickstart.html#data-preparation-1.) sustains +Note that `ext_bmiz()` allows for the `sex` variable to be coded using +[a range of possible values](#computing-bmi-percentiles-and-z-scores), but not +the same `0` and `1` values as `cleangrowth()`. This difference from the +`growthcleanr` +[data preparation specification](quickstart.html#data-preparation-1.) sustains compatibility with the CDC SAS macro. The `longwide()` function will handle this -conversion given the expected input values of `0` (male) or `1` (female). +conversion from `growthcleanr`'s `0` (male) or `1` (female), but not from other +coded values. -If you are using different input data for `ext_bmiz()`, ensure the `sex` -variable in your data set is properly coded. To do so, use `recode_sex()`. For -example, if you have data in the PCORnet CDM format, and want to prepare it for -`ext_bmiz()`: +If you are using input data with different value codes for `sex` with +`ext_bmiz()`, use `recode_sex()` to ensure your values are recoded first. For +example, if you have data in the PCORnet CDM format (using `M` and `F`), and +want to prepare it for `ext_bmiz()`: ```{r, eval = FALSE} recode_sex( @@ -163,7 +166,9 @@ output to match external specifications. ## Computing BMI percentiles and Z-scores -With data in wide format with BMI, and with sex variables properly coded, +With data in wide format with BMI, and with `sex` values properly coded (as any +of '1', 'b', 'B', 'Boys', 'm', 'M', 'male', or 'Male' for male subjects and any +of '2', 'g', 'G', 'Girls', 'f', 'F', 'female', or 'Female' for female subjects), `ext_bmiz()` can be called: ```{r, eval = FALSE} @@ -198,7 +203,7 @@ head(cleaned_data_bmiz) The output columns include: | variable | description | -| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | bmi | BMI | | bmiz, bmip | LMS / Extended z-score and percentile | | waz, wp | LMS Weight-for-sex/age z-score and percentile | @@ -211,43 +216,44 @@ The output columns include: | sev_obese | BMI >= 120% of 95th percentile (0/1) | | obese | BMI >= 95th percentile (0/1) | -For convenience, these labels are available on the output of `ext_bmiz()`, e.g., when -viewed in RStudio with `View(cleaned_data_bmi)`. +For convenience, these labels are available on the output of `ext_bmiz()`, e.g., +when viewed in RStudio with `View(cleaned_data_bmi)`. -Like `longwide()`, `ext_bmiz()` also includes options for mapping alternate column -names, for age, weight, height, and BMI. The default column names are the same as the -output from `longwide()` for convenience. If you have different column names, specify -the column names without quotes. For example, for a dataset using "heightcm" and -"weightkg" instead of "ht" and "wt": +Like `longwide()`, `ext_bmiz()` also includes options for mapping alternate +column names, for age, weight, height, and BMI. The default column names are the +same as the output from `longwide()` for convenience. If you have different +column names, specify the column names without quotes. For example, for a +dataset using "heightcm" and "weightkg" instead of "ht" and "wt": ```{r, eval = FALSE} my_cleaned_data_bmiz <- ext_bmiz(my_cleaned_data_wide_bmi, ht = heightcm, wt = weightkg) ``` -For `ext_bmiz()`, use the most precise age in months available. If an input dataset only -has age in months as integer values, by default `ext_bmiz()` will automatically convert -these to double values and add `0.5` to account for the distribution of actual ages over -the range of days within a month. This is enabled with the option `adjust.integer.age`, -set to `TRUE` by default. Specify `FALSE` to disable. +For `ext_bmiz()`, use the most precise age in months available. If an input +dataset only has age in months as integer values, by default `ext_bmiz()` will +automatically convert these to double values and add `0.5` to account for the +distribution of actual ages over the range of days within a month. This is +enabled with the option `adjust.integer.age`, set to `TRUE` by default. Specify +`FALSE` to disable. ```{r, eval = FALSE} my_cleaned_data_bmi <- ext_bmiz(my_cleaned_data_wide, adjust.integer.age = FALSE) ``` -`ext_bmiz()` uses reference data provided by the CDC, included in the `growthcleanr` -package as `inst/extdata/CDCref_d.csv`. This file is automatically loaded and used by -default. If you are working with a different reference dataset or developing the -`growthcleanr` package, specify an alternate path to this file with `ref.data.path`, as -for `cleangrowth()`. +`ext_bmiz()` uses reference data provided by the CDC, included in the +`growthcleanr` package as `inst/extdata/CDCref_d.csv`. This file is +automatically loaded and used by default. If you are working with a different +reference dataset or developing the `growthcleanr` package, specify an alternate +path to this file with `ref.data.path`, as for `cleangrowth()`. ## Related tools -The CDC provides a [SAS Program for the 2000 CDC Growth -Charts](https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm) which can -also be used to identify biologically implausible values using a different approach, as -also implemented for `growthcleanr` in the function `ext_bmiz()`, described above. The -SAS program was updated in December, 2022, and this function has been updated to match it -as of growthcleanr v2.1.0. +The CDC provides a +[SAS Program for the 2000 CDC Growth Charts](https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm) +which can also be used to identify biologically implausible values using a +different approach, as also implemented for `growthcleanr` in the function +`ext_bmiz()`, described above. The SAS program was updated in December, 2022, +and this function has been updated to match it as of growthcleanr v2.1.0. [GrowthViz](https://github.com/mitre/GrowthViz) provides insights into how `growthcleanr` assesses data, packaged in a Jupyter notebook. It ships with the From 1ca41fbb1f13038f6a89cd9bdc095935f517e677 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Fri, 3 Feb 2023 11:00:28 -0500 Subject: [PATCH 49/67] More tweaks to text flow in utilities vignette, refs #98 --- docs/articles/adult-algorithm.html | 2 +- docs/articles/configuration.html | 2 +- docs/articles/developer-guidelines.html | 2 +- docs/articles/installation.html | 2 +- docs/articles/large-data-sets.html | 2 +- docs/articles/next-steps.html | 2 +- docs/articles/output.html | 2 +- docs/articles/quickstart.html | 2 +- docs/articles/usage.html | 2 +- docs/articles/utilities.html | 46 +++++++++++++++---------- docs/pkgdown.yml | 2 +- docs/reference/ext_bmiz.html | 5 +-- man/ext_bmiz.Rd | 5 +-- vignettes/utilities.Rmd | 45 ++++++++++++++---------- 14 files changed, 71 insertions(+), 50 deletions(-) diff --git a/docs/articles/adult-algorithm.html b/docs/articles/adult-algorithm.html index 8ec13b75..457ec3a1 100644 --- a/docs/articles/adult-algorithm.html +++ b/docs/articles/adult-algorithm.html @@ -113,7 +113,7 @@ diff --git a/docs/articles/large-data-sets.html b/docs/articles/large-data-sets.html index c4fe7cd6..ecb9cbda 100644 --- a/docs/articles/large-data-sets.html +++ b/docs/articles/large-data-sets.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.3 + 2.1.0
    diff --git a/docs/articles/next-steps.html b/docs/articles/next-steps.html index b648abb0..67242538 100644 --- a/docs/articles/next-steps.html +++ b/docs/articles/next-steps.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.3 + 2.1.0
    diff --git a/docs/articles/output.html b/docs/articles/output.html index f1bac9ed..703469a8 100644 --- a/docs/articles/output.html +++ b/docs/articles/output.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.3 + 2.1.0
    diff --git a/docs/articles/quickstart.html b/docs/articles/quickstart.html index f98e1dcf..9c683f71 100644 --- a/docs/articles/quickstart.html +++ b/docs/articles/quickstart.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/articles/usage.html b/docs/articles/usage.html index e01142fd..3af58329 100644 --- a/docs/articles/usage.html +++ b/docs/articles/usage.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/articles/utilities.html b/docs/articles/utilities.html index f097d6a3..83c96c1a 100644 --- a/docs/articles/utilities.html +++ b/docs/articles/utilities.html @@ -33,7 +33,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/authors.html b/docs/authors.html index 719675d3..2627d81c 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 @@ -149,6 +149,10 @@

    Authors

    Soleymani Taraneh. Contributor.

    +
  • +

    Olivier Max. Contributor. +

    +
  • diff --git a/docs/index.html b/docs/index.html index 9fb39e67..f4685f96 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,7 +34,7 @@ growthcleanr - 2.0.3 + 2.1.0
    diff --git a/docs/news/index.html b/docs/news/index.html index f474ffc5..5d4b9f15 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0
    @@ -88,6 +88,19 @@

    Changelog

    Source: NEWS.md +
    + +
    +

    Added

    +
    • Use dependabot to update GitHub workflow action versions (#94)
    • +
    • Use GitHub action to build and publish container image (#101)
    • +
    +
    +

    Changed

    +
    • Updated ext_bmiz() to match Dec 2022 NCHS guidelines (#98)
    • +
    • New options to keep dates, columns, unmateched rows in longwide() (#71)
    • +
    +
    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 4f512000..9fd7905a 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -12,5 +12,5 @@ articles: quickstart: quickstart.html usage: usage.html utilities: utilities.html -last_built: 2023-02-03T15:58Z +last_built: 2023-02-03T17:22Z diff --git a/docs/reference/CDCref_d.html b/docs/reference/CDCref_d.html index 0b48c0bd..398903db 100644 --- a/docs/reference/CDCref_d.html +++ b/docs/reference/CDCref_d.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0
    diff --git a/docs/reference/acf_answers.html b/docs/reference/acf_answers.html index fe64c5c8..003bccb3 100644 --- a/docs/reference/acf_answers.html +++ b/docs/reference/acf_answers.html @@ -18,7 +18,7 @@ growthcleanr - 2.0.3 + 2.1.0
    diff --git a/docs/reference/adjustcarryforward.html b/docs/reference/adjustcarryforward.html index 8f011ed4..7e05c3e5 100644 --- a/docs/reference/adjustcarryforward.html +++ b/docs/reference/adjustcarryforward.html @@ -23,7 +23,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/bmianthro.html b/docs/reference/bmianthro.html index 2111b1b2..ebb705f0 100644 --- a/docs/reference/bmianthro.html +++ b/docs/reference/bmianthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/cleangrowth.html b/docs/reference/cleangrowth.html index f0d69df5..958dca6c 100644 --- a/docs/reference/cleangrowth.html +++ b/docs/reference/cleangrowth.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/ewma.html b/docs/reference/ewma.html index 7cd2d79f..f4cd4797 100644 --- a/docs/reference/ewma.html +++ b/docs/reference/ewma.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/ext_bmiz.html b/docs/reference/ext_bmiz.html index 911de047..6f85de5c 100644 --- a/docs/reference/ext_bmiz.html +++ b/docs/reference/ext_bmiz.html @@ -22,7 +22,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/growth_cdc_ext.html b/docs/reference/growth_cdc_ext.html index bc28bd86..3a99d834 100644 --- a/docs/reference/growth_cdc_ext.html +++ b/docs/reference/growth_cdc_ext.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/index.html b/docs/reference/index.html index 660c70e0..6ec1a596 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/lenanthro.html b/docs/reference/lenanthro.html index 71d04909..df6ac34b 100644 --- a/docs/reference/lenanthro.html +++ b/docs/reference/lenanthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/longwide.html b/docs/reference/longwide.html index 3b549153..e79b8a71 100644 --- a/docs/reference/longwide.html +++ b/docs/reference/longwide.html @@ -19,7 +19,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/nhanes-reference-medians.html b/docs/reference/nhanes-reference-medians.html index a24361e2..e40f3eb5 100644 --- a/docs/reference/nhanes-reference-medians.html +++ b/docs/reference/nhanes-reference-medians.html @@ -18,7 +18,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/read_anthro.html b/docs/reference/read_anthro.html index d6d8b703..40b3998b 100644 --- a/docs/reference/read_anthro.html +++ b/docs/reference/read_anthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/recode_sex.html b/docs/reference/recode_sex.html index 7bff85a6..cda9197b 100644 --- a/docs/reference/recode_sex.html +++ b/docs/reference/recode_sex.html @@ -18,7 +18,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/sd_median.html b/docs/reference/sd_median.html index 58b49289..dc7fb65d 100644 --- a/docs/reference/sd_median.html +++ b/docs/reference/sd_median.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/simple_bmi.html b/docs/reference/simple_bmi.html index f43d4c1e..886cd157 100644 --- a/docs/reference/simple_bmi.html +++ b/docs/reference/simple_bmi.html @@ -18,7 +18,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/splitinput.html b/docs/reference/splitinput.html index ba060881..d55d7f9a 100644 --- a/docs/reference/splitinput.html +++ b/docs/reference/splitinput.html @@ -21,7 +21,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/syngrowth.html b/docs/reference/syngrowth.html index b0192f30..9fdc996c 100644 --- a/docs/reference/syngrowth.html +++ b/docs/reference/syngrowth.html @@ -19,7 +19,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/tanner_ht_vel.html b/docs/reference/tanner_ht_vel.html index 8241a7ce..535bccfb 100644 --- a/docs/reference/tanner_ht_vel.html +++ b/docs/reference/tanner_ht_vel.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/tanner_ht_vel_with_2sd.html b/docs/reference/tanner_ht_vel_with_2sd.html index 0b75daab..7451f5ad 100644 --- a/docs/reference/tanner_ht_vel_with_2sd.html +++ b/docs/reference/tanner_ht_vel_with_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/test_syngrowth_sas_output_compare.html b/docs/reference/test_syngrowth_sas_output_compare.html index 5ad59501..5c6b4113 100644 --- a/docs/reference/test_syngrowth_sas_output_compare.html +++ b/docs/reference/test_syngrowth_sas_output_compare.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/test_syngrowth_wide.html b/docs/reference/test_syngrowth_wide.html index 06cfffe8..1bae0cc5 100644 --- a/docs/reference/test_syngrowth_wide.html +++ b/docs/reference/test_syngrowth_wide.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/testacf.html b/docs/reference/testacf.html index c43bc333..616fc880 100644 --- a/docs/reference/testacf.html +++ b/docs/reference/testacf.html @@ -20,7 +20,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/weianthro.html b/docs/reference/weianthro.html index 6c097bd6..511a174b 100644 --- a/docs/reference/weianthro.html +++ b/docs/reference/weianthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/who_ht_maxvel.html b/docs/reference/who_ht_maxvel.html index a512ff04..0500ed29 100644 --- a/docs/reference/who_ht_maxvel.html +++ b/docs/reference/who_ht_maxvel.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/who_ht_maxvel_2sd.html b/docs/reference/who_ht_maxvel_2sd.html index b88f1e09..4c06e08b 100644 --- a/docs/reference/who_ht_maxvel_2sd.html +++ b/docs/reference/who_ht_maxvel_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/who_ht_vel_2sd.html b/docs/reference/who_ht_vel_2sd.html index 936d77e2..062e7b64 100644 --- a/docs/reference/who_ht_vel_2sd.html +++ b/docs/reference/who_ht_vel_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 diff --git a/docs/reference/who_ht_vel_3sd.html b/docs/reference/who_ht_vel_3sd.html index bf5ff208..6516e4d3 100644 --- a/docs/reference/who_ht_vel_3sd.html +++ b/docs/reference/who_ht_vel_3sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.0.3 + 2.1.0 From 9d629261891ae3bfce16169733a52909323c6bf2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 22:11:18 +0000 Subject: [PATCH 52/67] Bump VaultVulp/gp-docker-action from 1.5.0 to 1.6.0 Bumps [VaultVulp/gp-docker-action](https://github.com/VaultVulp/gp-docker-action) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/VaultVulp/gp-docker-action/releases) - [Commits](https://github.com/VaultVulp/gp-docker-action/compare/1.5.0...1.6.0) --- updated-dependencies: - dependency-name: VaultVulp/gp-docker-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/build-and-publish-image-latest.yml | 2 +- .github/workflows/build-and-publish-image-tag.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish-image-latest.yml b/.github/workflows/build-and-publish-image-latest.yml index 486731be..be3ffeda 100644 --- a/.github/workflows/build-and-publish-image-latest.yml +++ b/.github/workflows/build-and-publish-image-latest.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v2.5.0 - name: Build and publish Docker image - uses: VaultVulp/gp-docker-action@1.5.0 + uses: VaultVulp/gp-docker-action@1.6.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} image-name: gcr-image diff --git a/.github/workflows/build-and-publish-image-tag.yml b/.github/workflows/build-and-publish-image-tag.yml index e6e4466f..7e149bcc 100644 --- a/.github/workflows/build-and-publish-image-tag.yml +++ b/.github/workflows/build-and-publish-image-tag.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2.5.0 - name: Build and publish Docker image - uses: VaultVulp/gp-docker-action@1.5.0 + uses: VaultVulp/gp-docker-action@1.6.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} image-name: gcr-image From 31a0ac91afd0accb2a3f9e19818fd47e57b92ba8 Mon Sep 17 00:00:00 2001 From: Dan Chudnov Date: Thu, 16 Feb 2023 14:35:23 -0500 Subject: [PATCH 53/67] Revert Dockerfile - build from repo, not CRAN Building from CRAN means we only get the latest CRAN build, not main! --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8eb8ff2b..a66d28db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN mkdir /app/R_libs RUN echo "R_LIBS_USER=/app/R_libs" > /home/gcuser/.Renviron RUN echo ".libPaths(c('/app/R_libs', .libPaths()))" > /home/gcuser/.Rprofile -RUN R -e "install.packages('growthcleanr', dependencies = TRUE, lib='/app/R_libs')" +RUN R -e "devtools::install_github('mitre/growthcleanr', dependencies = TRUE, ref = 'main', lib = '/app/R_libs')" ADD exec/gcdriver.R /usr/local/bin/ RUN chmod ugo+rx /usr/local/bin/gcdriver.R From ae1f5d38ab20fdcd11b6bfb793fc466a110fe518 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Thu, 16 Feb 2023 14:39:17 -0500 Subject: [PATCH 54/67] Update citation interface --- inst/CITATION | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/inst/CITATION b/inst/CITATION index d4dbeb3d..18bfd106 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,14 +1,12 @@ -citHeader("To cite growthcleanr in publications use:") - -citEntry(entry = "Article", +bibentry(bibtype = "Article", title = "Automated identification of implausible values in growth data from pediatric electronic health records", - author = personList( - as.person("Carrie Daymont"), - as.person("Michelle E Ross"), + author = c( + person("Carrie Daymont"), + person("Michelle E Ross"), person(given="A", family = "Russell Localio"), - as.person("Alexander G Fiks"), - as.person("Richard C Wasserman"), - as.person("Robert W Grundmeier")), + person("Alexander G Fiks"), + person("Richard C Wasserman"), + person("Robert W Grundmeier")), journal = "Journal of the American Medical Informatics Association", year = "2017", doi = "10.1093/jamia/ocx037", @@ -22,4 +20,4 @@ citEntry(entry = "Article", textVersion = paste("Carrie Daymont, Michelle E Ross, A Russell Localio, Alexander G Fiks, Richard C Wasserman, Robert W Grundmeier, Automated identification of implausible values in growth data from pediatric electronic health records, Journal of the American Medical Informatics Association, Volume 24, Issue 6, November 2017, Pages 1080–1087, https://doi.org/10.1093/jamia/ocx037") -) \ No newline at end of file +) From 7201880f262a68a6bdf579f358087099b639864e Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Thu, 16 Feb 2023 14:40:59 -0500 Subject: [PATCH 55/67] Update CRAN submission info --- cran-comments.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cran-comments.md b/cran-comments.md index d79f3924..340a9b76 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -9,6 +9,14 @@ There are currently no downstream dependencies for this package. # Previous Submissions +# CRAN submission growthcleanr 2.1.0 (1) + +## R CMD check results +There were no ERRORs, WARNINGs, or NOTEs. + +## Downstream dependencies +There are currently no downstream dependencies for this package. + # CRAN submission growthcleanr 2.0.3 ## R CMD check results From 2a60074b925994cbddfa1a13192cf26d8db6651d Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Thu, 16 Feb 2023 14:41:10 -0500 Subject: [PATCH 56/67] Updated NEWS --- .Rbuildignore | 1 + NEWS.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 324d41b9..501c4297 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,3 +17,4 @@ Dockerfile cran-comments.md ^LICENSE\.md$ ^vignettes$ +.DS_Store diff --git a/NEWS.md b/NEWS.md index 60c64538..2c669da3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,7 +8,9 @@ ## Changed - Updated `ext_bmiz()` to match Dec 2022 NCHS guidelines (#98) -- New options to keep dates, columns, unmateched rows in `longwide()` (#71) +- New options to keep dates, columns, unmatched rows in `longwide()` (#71) +- Updated CITATION to match new CRAN requirements +- Updated Dockerfile to build from repo, not CRAN # growthcleanr 2.0.3 - 2022-11-01 From a2c027fa74c8cd6080464b70a877f80ffed11eee Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Thu, 16 Feb 2023 14:46:42 -0500 Subject: [PATCH 57/67] Update cran comments --- cran-comments.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cran-comments.md b/cran-comments.md index 340a9b76..d94554f8 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -6,6 +6,18 @@ There were no ERRORs, WARNINGs, or NOTEs. ## Downstream dependencies There are currently no downstream dependencies for this package. +## CRAN manual test + +We have addressed each of the notes in the manual test as below: + +* Package CITATION file contains call(s) to old-style personList() or + as.personList(). Please use c() on person objects instead. + Package CITATION file contains call(s) to old-style citEntry() or + citHeader()/citFooter(). Please use bibentry() instead, possibly with + arguments 'header' and 'footer'. + + +We have updated the citation accordingly. # Previous Submissions From 659a15aa8f50b9a1e4661df68e2cbd1c0c98dcd0 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Mon, 27 Feb 2023 16:25:36 -0500 Subject: [PATCH 58/67] Update name orientation and add Dan email --- DESCRIPTION | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5b4132a2..1ce8980a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,22 +3,22 @@ Type: Package Title: Data Cleaner for Anthropometric Measurements Version: 2.1.0 Authors@R: c( - person("Daymont","Carrie", email = "cdaymont@pennstatehealth.psu.edu", role = c("ctb","cre")), - person("Grundmeier","Robert", role = "aut"), - person("Miller","Jeffrey", role = "aut"), - person("Campos","Diego", role = "aut"), - person("Chudnov","Dan", role = "ctb"), - person("De los Santos","Hannah", email = "hdelossantos@mitre.org", role = c("ctb")), - person("Cao","Lusha", role = "ctb"), - person("Silva","Steffani", role = "ctb"), - person("Zhang","Hanzhe", role = "ctb"), - person("Boyas","Matt", role = "ctb"), - person("Freedman","David", role = "ctb"), - person("Achilleos","Andreas", role = "ctb"), - person("Butts","Jessica", role = "ctb"), - person("Nguyen","Sheila", role = "ctb"), - person("Soleymani","Taraneh", role = "ctb"), - person("Olivier","Max", role = "ctb") + person("Carrie", "Daymont", email = "cdaymont@pennstatehealth.psu.edu", role = c("ctb","cre")), + person("Robert", "Grundmeier", role = "aut"), + person("Jeffrey", "Miller", role = "aut"), + person("Diego", "Campos", role = "aut"), + person("Dan", "Chudnov", email = "dlchudnov@mitre.org", role = "ctb"), + person("Hannah", "De los Santos", email = "hdelossantos@mitre.org", role = c("ctb")), + person("Lusha", "Cao", role = "ctb"), + person("Steffani", "Silva", role = "ctb"), + person("Hanzhe", "Zhang", role = "ctb"), + person("Matt", "Boyas", role = "ctb"), + person("David", "Freedman", role = "ctb"), + person("Andreas", "Achilleos", role = "ctb"), + person("Jessica", "Butts", role = "ctb"), + person("Sheila", "Nguyen", role = "ctb"), + person("Taraneh", "Soleymani", role = "ctb"), + person("Max", "Olivier", role = "ctb") ) Description: Identifies implausible anthropometric (e.g., height, weight) measurements in irregularly spaced longitudinal datasets, such as those from electronic health records. From 77177c77ce77435fa4469b9b2883e0e44976bcc2 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Mon, 27 Feb 2023 17:26:04 -0500 Subject: [PATCH 59/67] Add missing to adult output --- R/growth.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/growth.R b/R/growth.R index ab471954..2842575a 100644 --- a/R/growth.R +++ b/R/growth.R @@ -654,6 +654,10 @@ cleangrowth <- function(subjid, ) } + # replace result with missing if measurement or agedays are missing + res[is.na(measurement) | + agedays < 0, result := "Missing"] + if (parallel){ stopCluster(cl) } From a86b6e833426954b4701fe764bc9670e8e13fe85 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Mon, 27 Feb 2023 17:49:01 -0500 Subject: [PATCH 60/67] Fix missing binding, coercion to data frame --- R/growth.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/growth.R b/R/growth.R index 2842575a..6adf32c1 100644 --- a/R/growth.R +++ b/R/growth.R @@ -160,6 +160,7 @@ cleangrowth <- function(subjid, N <- age_years <- batch <- exclude <- index <- line <- NULL newbatch <- sd.median <- sd.orig <- tanner.months <- tbc.sd <- NULL v <- v_adult <- whoagegrp.ht <- whoagegrp_ht <- z.orig <- NULL + result <- NULL # preprocessing ---- @@ -652,11 +653,12 @@ cleangrowth <- function(subjid, .paropts = list(.packages = "data.table"), weight_cap = weight_cap ) + + res <- as.data.table(res) } # replace result with missing if measurement or agedays are missing - res[is.na(measurement) | - agedays < 0, result := "Missing"] + res[is.na(measurement) | agedays < 0, result := "Missing"] if (parallel){ stopCluster(cl) From f0a0dd5c57181b4b6793031f3f3aa0d5f031d7be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 23:13:02 +0000 Subject: [PATCH 61/67] Bump actions/checkout from 2.5.0 to 3.3.0 Bumps [actions/checkout](https://github.com/actions/checkout) from 2.5.0 to 3.3.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.5.0...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build-and-publish-image-latest.yml | 2 +- .github/workflows/build-and-publish-image-tag.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish-image-latest.yml b/.github/workflows/build-and-publish-image-latest.yml index be3ffeda..478f1fba 100644 --- a/.github/workflows/build-and-publish-image-latest.yml +++ b/.github/workflows/build-and-publish-image-latest.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.5.0 + - uses: actions/checkout@v3 - name: Build and publish Docker image uses: VaultVulp/gp-docker-action@1.6.0 diff --git a/.github/workflows/build-and-publish-image-tag.yml b/.github/workflows/build-and-publish-image-tag.yml index 7e149bcc..b28372dd 100644 --- a/.github/workflows/build-and-publish-image-tag.yml +++ b/.github/workflows/build-and-publish-image-tag.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.5.0 + - uses: actions/checkout@v3 - name: Build and publish Docker image uses: VaultVulp/gp-docker-action@1.6.0 From baecdabb415ede12557562bed649a909b2a55bfe Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 28 Feb 2023 15:20:27 -0500 Subject: [PATCH 62/67] Add dropped RV codes to factor processing --- R/growth.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/growth.R b/R/growth.R index 6adf32c1..7aa85c83 100644 --- a/R/growth.R +++ b/R/growth.R @@ -240,8 +240,11 @@ cleangrowth <- function(subjid, "Include", "Exclude-Adult-BIV", "Exclude-Adult-Hundreds", + "Exclude-Adult-Hundreds-RV", "Exclude-Adult-Unit-Errors", + "Exclude-Adult-Unit-Errors-RV", "Exclude-Adult-Transpositions", + "Exclude-Adult-Transpositions-RV", "Exclude-Adult-Weight-Cap-Identical", "Exclude-Adult-Weight-Cap", "Exclude-Adult-Swapped-Measurements", @@ -250,6 +253,7 @@ cleangrowth <- function(subjid, "Exclude-Adult-Distinct-Pairs", "Exclude-Adult-Distinct-3-Or-More", "Exclude-Adult-EWMA-Extreme", + "Exclude-Adult-EWMA-Extreme-RV", "Exclude-Adult-Distinct-Ordered-Pairs", "Exclude-Adult-EWMA-Moderate", "Exclude-Adult-Possibly-Impacted-By-Weight-Cap", From 7b46e4803991e1e9a44d7cafdeca01284a2d8235 Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Tue, 28 Feb 2023 16:06:48 -0500 Subject: [PATCH 63/67] Update tests to test for missingness --- tests/testthat/test-cleangrowth.R | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/testthat/test-cleangrowth.R b/tests/testthat/test-cleangrowth.R index 71d81880..38b8541c 100644 --- a/tests/testthat/test-cleangrowth.R +++ b/tests/testthat/test-cleangrowth.R @@ -88,6 +88,24 @@ test_that("growthcleanr works as expected on pediatric synthetic data", { expect_equal(113, catcount(d100_derived_exclusions, "Exclude-Carried-Forward")) expect_equal(3, catcount(d100_derived_exclusions, "Exclude-EWMA-8")) + # also run a test to make sure missing data returns as "missing" + d5_miss <- as.data.table(data_peds)[subjid %in% unique(data[, subjid])[1:5], ] + + # add missing data randomly for 5 values + set.seed(10) + d5_miss$measurement[sample(1:nrow(d5_miss), 5)] <- NA + + d5_miss <- + d5_miss[, gcr_result := cleangrowth( + subjid, + param, + agedays, + sex, + measurement + )] + + expect_equal(sum(d5_miss$gcr_result == "Missing"), 5) + }) test_that("growthcleanr works as expected on adult synthetic data", { @@ -174,6 +192,24 @@ test_that("growthcleanr works as expected on adult synthetic data", { expect_true(is.na(catcount(d100cp_exclusions, "Exclude-Carried-Forward"))) expect_equal(14, catcount(d100cp_exclusions, "Exclude-Adult-BIV")) + # also run a test to make sure missing data returns as "missing" + d5_miss <- as.data.table(data_adult)[subjid %in% unique(data[, subjid])[1:5], ] + + # add missing data randomly for 5 values + set.seed(10) + d5_miss$measurement[sample(1:nrow(d5_miss), 5)] <- NA + + d5_miss <- + d5_miss[, gcr_result := cleangrowth( + subjid, + param, + agedays, + sex, + measurement + )] + + expect_equal(sum(d5_miss$gcr_result == "Missing"), 5) + }) test_that("growthcleanr works without either adult or pediatric data", { From 2c3237c91eb01a1370efabc866ab7375990cbf2e Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Wed, 1 Mar 2023 14:23:32 -0500 Subject: [PATCH 64/67] Update version and notes --- DESCRIPTION | 2 +- NEWS.md | 10 ++++++++++ cran-comments.md | 12 ++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1ce8980a..ff94c08f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: growthcleanr Type: Package Title: Data Cleaner for Anthropometric Measurements -Version: 2.1.0 +Version: 2.1.1 Authors@R: c( person("Carrie", "Daymont", email = "cdaymont@pennstatehealth.psu.edu", role = c("ctb","cre")), person("Robert", "Grundmeier", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 2c669da3..e97381af 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,13 @@ +# growthcleanr 2.1.1 - 2023-03-01 + +## Changed + +- Fixed missing adult measurements to be labeled "Missing" in output (#119) +- Added tests for missingness in adult output +- Fixed missing "-RV" codes in adult output +- Corrected contributor names in DESCRIPTION (#120) +- Added email for Dan Chudnov in DESCRIPTION (#95) + # growthcleanr 2.1.0 - 2023-02-03 ## Added diff --git a/cran-comments.md b/cran-comments.md index d94554f8..340ea866 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,13 @@ +# CRAN submission growthcleanr 2.1.1 + +## R CMD check results +There were no ERRORs, WARNINGs, or NOTEs. + +## Downstream dependencies +There are currently no downstream dependencies for this package. + +# Previous Submissions + # CRAN submission growthcleanr 2.1.0 ## R CMD check results @@ -19,8 +29,6 @@ We have addressed each of the notes in the manual test as below: We have updated the citation accordingly. -# Previous Submissions - # CRAN submission growthcleanr 2.1.0 (1) ## R CMD check results From 9840446fb0ffdbc912b87279850be9aa560cdd4e Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Wed, 1 Mar 2023 14:35:36 -0500 Subject: [PATCH 65/67] Update packagedown site --- docs/404.html | 6 +- docs/LICENSE-text.html | 6 +- docs/LICENSE.html | 6 +- docs/articles/adult-algorithm.html | 8 +- docs/articles/configuration.html | 8 +- docs/articles/developer-guidelines.html | 8 +- docs/articles/index.html | 6 +- docs/articles/installation.html | 26 ++-- docs/articles/large-data-sets.html | 62 ++++----- docs/articles/next-steps.html | 126 +++++++++--------- docs/articles/output.html | 8 +- docs/articles/quickstart.html | 8 +- docs/articles/usage.html | 92 ++++++------- docs/articles/utilities.html | 110 +++++++-------- docs/authors.html | 40 +++--- docs/index.html | 14 +- docs/news/index.html | 23 +++- docs/pkgdown.yml | 6 +- docs/reference/CDCref_d.html | 6 +- docs/reference/acf_answers.html | 6 +- docs/reference/adjustcarryforward.html | 6 +- docs/reference/bmianthro.html | 6 +- docs/reference/cleangrowth.html | 14 +- docs/reference/ewma.html | 6 +- docs/reference/ext_bmiz.html | 6 +- docs/reference/growth_cdc_ext.html | 6 +- docs/reference/index.html | 6 +- docs/reference/lenanthro.html | 6 +- docs/reference/longwide.html | 6 +- docs/reference/nhanes-reference-medians.html | 6 +- docs/reference/read_anthro.html | 6 +- docs/reference/recode_sex.html | 6 +- docs/reference/sd_median.html | 6 +- docs/reference/simple_bmi.html | 6 +- docs/reference/splitinput.html | 6 +- docs/reference/syngrowth.html | 6 +- docs/reference/tanner_ht_vel.html | 6 +- docs/reference/tanner_ht_vel_with_2sd.html | 6 +- .../test_syngrowth_sas_output_compare.html | 6 +- docs/reference/test_syngrowth_wide.html | 6 +- docs/reference/testacf.html | 6 +- docs/reference/weianthro.html | 6 +- docs/reference/who_ht_maxvel.html | 6 +- docs/reference/who_ht_maxvel_2sd.html | 6 +- docs/reference/who_ht_vel_2sd.html | 6 +- docs/reference/who_ht_vel_3sd.html | 6 +- docs/sitemap.xml | 22 +-- 47 files changed, 387 insertions(+), 374 deletions(-) diff --git a/docs/404.html b/docs/404.html index 09c0ac49..4b745506 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -128,12 +128,12 @@

    Page not found (404)

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index b5c602c9..6f6bd6cd 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -102,11 +102,11 @@

    License

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 1a85f82a..8b2cba29 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -106,11 +106,11 @@

    MIT License

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/articles/adult-algorithm.html b/docs/articles/adult-algorithm.html index fb58b0e4..a0fcb944 100644 --- a/docs/articles/adult-algorithm.html +++ b/docs/articles/adult-algorithm.html @@ -33,7 +33,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -113,7 +113,7 @@ @@ -113,7 +113,7 @@

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/articles/developer-guidelines.html b/docs/articles/developer-guidelines.html index 22c68701..e9da9cdc 100644 --- a/docs/articles/developer-guidelines.html +++ b/docs/articles/developer-guidelines.html @@ -33,7 +33,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -113,7 +113,7 @@ @@ -122,11 +122,11 @@

    Advanced

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/articles/installation.html b/docs/articles/installation.html index eca768fb..5c56c705 100644 --- a/docs/articles/installation.html +++ b/docs/articles/installation.html @@ -33,7 +33,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -113,7 +113,7 @@ @@ -113,7 +113,7 @@ +
    Rscript exec/gcdriver.R --numbatches 4 --adult_split 50 my-large-input.csv my-large-input-cleaned.csv
    • --numbatches 4 may be a good starting point for testing @@ -293,29 +293,29 @@

      Reference for gcdriver.R

      All available options for gcdriver.R are described below.

      -
      Rscript exec/gcdriver.R --help
      -usage: gcdriver.R [--] [--help] [--quietly] [--opts OPTS] [--sdrecenter
      -       SDRECENTER] [--adult_cutpoint ADULT_CUTPOINT] [--weightcap
      -       WEIGHTCAP] [--numbatches NUMBATCHES] [--adult_split ADULT_SPLIT]
      -       infile outfile
      -
      -CLI driver for growthcleanr
      -
      -positional arguments:
      -  infile                input file
      -  outfile               output file
      -
      -flags:
      -  -h, --help            show this help message and exit
      -  -q, --quietly         Disable verbose output
      -
      -optional arguments:
      -  -x, --opts            RDS file containing argument values
      -  -s, --sdrecenter      sd.recenter data file [default: ]
      -  -a, --adult_cutpoint  adult cutpoint [default: 20]
      -  -w, --weightcap       weight cap [default: Inf]
      -  -n, --numbatches      Number of batches [default: 1]
      -  --adult_split         Number of splits to run data on [default: Inf]
      +
      Rscript exec/gcdriver.R --help
      +usage: gcdriver.R [--] [--help] [--quietly] [--opts OPTS] [--sdrecenter
      +       SDRECENTER] [--adult_cutpoint ADULT_CUTPOINT] [--weightcap
      +       WEIGHTCAP] [--numbatches NUMBATCHES] [--adult_split ADULT_SPLIT]
      +       infile outfile
      +
      +CLI driver for growthcleanr
      +
      +positional arguments:
      +  infile                input file
      +  outfile               output file
      +
      +flags:
      +  -h, --help            show this help message and exit
      +  -q, --quietly         Disable verbose output
      +
      +optional arguments:
      +  -x, --opts            RDS file containing argument values
      +  -s, --sdrecenter      sd.recenter data file [default: ]
      +  -a, --adult_cutpoint  adult cutpoint [default: 20]
      +  -w, --weightcap       weight cap [default: Inf]
      +  -n, --numbatches      Number of batches [default: 1]
      +  --adult_split         Number of splits to run data on [default: Inf]
      @@ -331,12 +331,12 @@

      Reference for gcdriver.R

      -

      Site built with pkgdown 2.0.7.

      +

      Site built with pkgdown 2.0.6.

      diff --git a/docs/articles/next-steps.html b/docs/articles/next-steps.html index 67242538..c88f3564 100644 --- a/docs/articles/next-steps.html +++ b/docs/articles/next-steps.html @@ -33,7 +33,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -113,7 +113,7 @@ @@ -113,7 +113,7 @@ @@ -113,7 +113,7 @@ @@ -113,7 +113,7 @@ +
      Warning messages:
      +1: <anonymous>: ... may be used in an incorrect context:.fun(piece, ...)’
      +2: <anonymous>: ... may be used in an incorrect context:.fun(piece, ...)’

      This set of warnings is coming from one of growthcleanr’s dependencies, and does not indicate either failure or improper execution.

      @@ -301,12 +301,12 @@

      Basic configuration options

      -

      Developed by Daymont Carrie, Grundmeier Robert, Miller Jeffrey, Campos Diego.

      +

      Developed by Carrie Daymont, Robert Grundmeier, Jeffrey Miller, Diego Campos.

      -

      Site built with pkgdown 2.0.7.

      +

      Site built with pkgdown 2.0.6.

      diff --git a/docs/articles/utilities.html b/docs/articles/utilities.html index 83c96c1a..06d81a07 100644 --- a/docs/articles/utilities.html +++ b/docs/articles/utilities.html @@ -33,7 +33,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -114,7 +114,7 @@

      Utilities for computing pediatric BMI percentiles, Z-scores, and related tools

      -

      2023-02-03

      +

      2023-03-01

      Source: vignettes/utilities.Rmd @@ -188,27 +188,27 @@

      Converting long g

      Note that this assumes that cleaned_data has the same structure as described in Quickstart - Data preparation:

      -
      names(cleaned_data)
      -[1] "id"          "subjid"      "sex"         "agedays"     "param"       "measurement" "gcr_result"
      +
      names(cleaned_data)
      +[1] "id"          "subjid"      "sex"         "agedays"     "param"       "measurement" "gcr_result"

      The wide dataset cleaned_data_wide will include rows with aligned height and weight measurements drawn from the observations in cleaned_data marked by cleangrowth() for inclusion. As such, it will be a shorter dataset (fewer rows) based on fewer observations.

      -
      dim(cleaned_data)
      -[1] 85728     7
      -
      -dim(cleaned_data_wide)
      -[1] 26701     9
      -
      -head(cleaned_data_wide)
      -                                subjid    agey     agem sex   wt wt_id    ht ht_id  agedays
      -1 002986c5-354d-bb9d-c180-4ce26813ca28 56.0964 673.1568   2 71.7 83331 151.1 83330 20489.22
      -2 002986c5-354d-bb9d-c180-4ce26813ca28 57.1122 685.3464   2 73.2 83333 151.1 83332 20860.22
      -3 002986c5-354d-bb9d-c180-4ce26813ca28 58.1279 697.5348   2 74.6 83336 151.1 83335 21231.22
      -4 002986c5-354d-bb9d-c180-4ce26813ca28 59.1437 709.7244   2 72.8 83338 151.1 83337 21602.22
      -5 002986c5-354d-bb9d-c180-4ce26813ca28 59.2012 710.4144   2 72.4 83340 151.1 83339 21623.22
      -6 002986c5-354d-bb9d-c180-4ce26813ca28 60.1594 721.9128   2 69.4 83343 151.1 83342 21973.22
      +
      dim(cleaned_data)
      +[1] 85728     7
      +
      +dim(cleaned_data_wide)
      +[1] 26701     9
      +
      +head(cleaned_data_wide)
      +                                subjid    agey     agem sex   wt wt_id    ht ht_id  agedays
      +1 002986c5-354d-bb9d-c180-4ce26813ca28 56.0964 673.1568   2 71.7 83331 151.1 83330 20489.22
      +2 002986c5-354d-bb9d-c180-4ce26813ca28 57.1122 685.3464   2 73.2 83333 151.1 83332 20860.22
      +3 002986c5-354d-bb9d-c180-4ce26813ca28 58.1279 697.5348   2 74.6 83336 151.1 83335 21231.22
      +4 002986c5-354d-bb9d-c180-4ce26813ca28 59.1437 709.7244   2 72.8 83338 151.1 83337 21602.22
      +5 002986c5-354d-bb9d-c180-4ce26813ca28 59.2012 710.4144   2 72.4 83340 151.1 83339 21623.22
      +6 002986c5-354d-bb9d-c180-4ce26813ca28 60.1594 721.9128   2 69.4 83343 151.1 83342 21973.22

      In this example, the subject identifiers previously marked as subjid are now in the id column; individual identifiers for observations of a single parameter are not present.

      @@ -216,15 +216,15 @@

      Converting long g your input set uses different column names. For example, if my_cleaned_data specifies age in days as aged and parameter type as type, specify each, with quotes:

      -
      head(my_cleaned_data)
      -     id subjid sex    aged     type measurement                  gcr_result
      -1: 1510 775155   0     889 HEIGHTCM       84.90 Exclude-Extraneous-Same-Day
      -2: 1511 775155   0     889 HEIGHTCM       89.06                     Include
      -3: 1518 775155   0     889 WEIGHTKG       13.10                     Include
      -4: 1512 775155   0    1071 HEIGHTCM       92.50                     Include
      -5: 1519 775155   0    1071 WEIGHTKG       14.70                     Include
      -6: 1513 775155   0    1253 HEIGHTCM       96.20                     Include
      -longwide(my_cleaned_data, agedays = "aged", param = "type")
      +
      head(my_cleaned_data)
      +     id subjid sex    aged     type measurement                  gcr_result
      +1: 1510 775155   0     889 HEIGHTCM       84.90 Exclude-Extraneous-Same-Day
      +2: 1511 775155   0     889 HEIGHTCM       89.06                     Include
      +3: 1518 775155   0     889 WEIGHTKG       13.10                     Include
      +4: 1512 775155   0    1071 HEIGHTCM       92.50                     Include
      +5: 1519 775155   0    1071 WEIGHTKG       14.70                     Include
      +6: 1513 775155   0    1253 HEIGHTCM       96.20                     Include
      +longwide(my_cleaned_data, agedays = "aged", param = "type")

      By default, longwide() will only transform records flagged by cleangrowth() for inclusion. To include more categories assigned by cleangrowth(), use the @@ -287,32 +287,32 @@

      Computing BMI percentiles and Z- ‘Male’ for male subjects and any of ‘2’, ‘g’, ‘G’, ‘Girls’, ‘f’, ‘F’, ‘female’, or ‘Female’ for female subjects), ext_bmiz() can be called:

      -
      cleaned_data_bmiz <- ext_bmiz(cleaned_data_bmi)
      -head(cleaned_data_bmiz)
      -                                 subjid    agey      age   sex    wt wt_id    ht ht_id agedays      bmi      bmiz
      -                                 <char>   <num>    <num> <int> <num> <int> <num> <int>   <int>    <num>     <num>
      -1: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 10.0233 120.2796     2  35.4    17 141.6    15    3661 17.65537 0.3236612
      -2: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 11.0390 132.4680     2  39.2    19 147.9    18    4032 17.92048 0.1734315
      -3: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 12.0548 144.6576     2  44.8    21 155.1    20    4403 18.62320 0.1832443
      -4: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 12.5914 151.0968     2  47.8    23 158.7    22    4599 18.97903 0.1829183
      -5: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 13.0705 156.8460     2  50.5    26 160.8    24    4774 19.53077 0.2586449
      -6: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad  3.9288  47.1456     2  16.6     2 102.6     1    1435 15.76933 0.3453978
      -       bmip       waz       wp       haz       hp      p95      p97   bmip95   mod_bmiz   mod_waz   mod_haz
      -      <num>     <num>    <num>     <num>    <num>    <num>    <num>    <num>      <num>     <num>     <num>
      -1: 62.69027 0.3498817 63.67862 0.5140553 69.63933 22.96109 24.57902 76.89254 0.18485501 0.2399201 0.5008944
      -2: 56.88438 0.2311645 59.14065 0.5002225 69.15408 24.13836 25.90525 74.24067 0.09543668 0.1556259 0.4955022
      -3: 57.26968 0.3237374 62.69316 0.4803298 68.45036 25.26981 27.17179 73.69745 0.10065274 0.2201655 0.4855100
      -4: 57.25689 0.3812700 64.84986 0.5153244 69.68368 25.83904 27.80781 73.45100 0.10011666 0.2596479 0.5212281
      -5: 60.20454 0.4440465 67.14955 0.4849566 68.61464 26.32757 28.35405 74.18371 0.14353771 0.3024342 0.4885546
      -6: 63.51023 0.4369963 66.89430 0.5348018 70.36065 18.02950 18.60078 87.46409 0.24462581 0.3332011 0.5224816
      -      sigma original_bmip original_bmiz sev_obese obese
      -      <num>         <num>         <num>     <int> <int>
      -1: 4.443536      62.69027     0.3236612         0     0
      -2: 4.797031      56.88438     0.1734315         0     0
      -3: 5.148292      57.26968     0.1832443         0     0
      -4: 5.332930      57.25689     0.1829183         0     0
      -5: 5.497248      60.20454     0.2586449         0     0
      -6: 2.274792      63.51023     0.3453978         0     0
      +
      cleaned_data_bmiz <- ext_bmiz(cleaned_data_bmi)
      +head(cleaned_data_bmiz)
      +                                 subjid    agey      age   sex    wt wt_id    ht ht_id agedays      bmi      bmiz
      +                                 <char>   <num>    <num> <int> <num> <int> <num> <int>   <int>    <num>     <num>
      +1: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 10.0233 120.2796     2  35.4    17 141.6    15    3661 17.65537 0.3236612
      +2: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 11.0390 132.4680     2  39.2    19 147.9    18    4032 17.92048 0.1734315
      +3: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 12.0548 144.6576     2  44.8    21 155.1    20    4403 18.62320 0.1832443
      +4: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 12.5914 151.0968     2  47.8    23 158.7    22    4599 18.97903 0.1829183
      +5: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad 13.0705 156.8460     2  50.5    26 160.8    24    4774 19.53077 0.2586449
      +6: 001aa16d-bf0e-a077-3b3d-5ab8b58545ad  3.9288  47.1456     2  16.6     2 102.6     1    1435 15.76933 0.3453978
      +       bmip       waz       wp       haz       hp      p95      p97   bmip95   mod_bmiz   mod_waz   mod_haz
      +      <num>     <num>    <num>     <num>    <num>    <num>    <num>    <num>      <num>     <num>     <num>
      +1: 62.69027 0.3498817 63.67862 0.5140553 69.63933 22.96109 24.57902 76.89254 0.18485501 0.2399201 0.5008944
      +2: 56.88438 0.2311645 59.14065 0.5002225 69.15408 24.13836 25.90525 74.24067 0.09543668 0.1556259 0.4955022
      +3: 57.26968 0.3237374 62.69316 0.4803298 68.45036 25.26981 27.17179 73.69745 0.10065274 0.2201655 0.4855100
      +4: 57.25689 0.3812700 64.84986 0.5153244 69.68368 25.83904 27.80781 73.45100 0.10011666 0.2596479 0.5212281
      +5: 60.20454 0.4440465 67.14955 0.4849566 68.61464 26.32757 28.35405 74.18371 0.14353771 0.3024342 0.4885546
      +6: 63.51023 0.4369963 66.89430 0.5348018 70.36065 18.02950 18.60078 87.46409 0.24462581 0.3332011 0.5224816
      +      sigma original_bmip original_bmiz sev_obese obese
      +      <num>         <num>         <num>     <int> <int>
      +1: 4.443536      62.69027     0.3236612         0     0
      +2: 4.797031      56.88438     0.1734315         0     0
      +3: 5.148292      57.26968     0.1832443         0     0
      +4: 5.332930      57.25689     0.1829183         0     0
      +5: 5.497248      60.20454     0.2586449         0     0
      +6: 2.274792      63.51023     0.3453978         0     0

      The output columns include:

    variable
    @@ -432,12 +432,12 @@

    Authors

    • -

      Daymont Carrie. Contributor, maintainer. +

      Carrie Daymont. Contributor, maintainer.

    • -

      Grundmeier Robert. Author. +

      Robert Grundmeier. Author.

    • -

      Miller Jeffrey. Author. +

      Jeffrey Miller. Author.

    • -

      Campos Diego. Author. +

      Diego Campos. Author.

    • -

      Chudnov Dan. Contributor. +

      Dan Chudnov. Contributor.

    • -

      De los Santos Hannah. Contributor. +

      Hannah De los Santos. Contributor.

    • -

      Cao Lusha. Contributor. +

      Lusha Cao. Contributor.

    • -

      Silva Steffani. Contributor. +

      Steffani Silva. Contributor.

    • -

      Zhang Hanzhe. Contributor. +

      Hanzhe Zhang. Contributor.

    • -

      Boyas Matt. Contributor. +

      Matt Boyas. Contributor.

    • -

      Freedman David. Contributor. +

      David Freedman. Contributor.

    • -

      Achilleos Andreas. Contributor. +

      Andreas Achilleos. Contributor.

    • -

      Butts Jessica. Contributor. +

      Jessica Butts. Contributor.

    • -

      Nguyen Sheila. Contributor. +

      Sheila Nguyen. Contributor.

    • -

      Soleymani Taraneh. Contributor. +

      Taraneh Soleymani. Contributor.

    • -

      Olivier Max. Contributor. +

      Max Olivier. Contributor.

    @@ -165,7 +165,7 @@

    Citation

    Carrie Daymont, Michelle E Ross, A Russell Localio, Alexander G Fiks, Richard C Wasserman, Robert W Grundmeier, Automated identification of implausible values in growth data from pediatric electronic health records, Journal of the American Medical Informatics Association, Volume 24, Issue 6, November 2017, Pages 1080–1087, https://doi.org/10.1093/jamia/ocx037

    @Article{,
       title = {Automated identification of implausible values in growth data from pediatric electronic health records},
    -  author = {Carrie Daymont and Michelle E Ross and A {Russell Localio} and Alexander G Fiks and Richard C Wasserman and Robert W Grundmeier},
    +  author = {{Carrie Daymont} and {Michelle E Ross} and A {Russell Localio} and {Alexander G Fiks} and {Richard C Wasserman} and {Robert W Grundmeier}},
       journal = {Journal of the American Medical Informatics Association},
       year = {2017},
       doi = {10.1093/jamia/ocx037},
    @@ -185,11 +185,11 @@ 

    Citation

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/index.html b/docs/index.html index f4685f96..bc38098c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,7 +34,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -207,10 +207,10 @@

    Citation

    Developers

      -
    • Daymont Carrie
      Contributor, maintainer
    • -
    • Grundmeier Robert
      Author
    • -
    • Miller Jeffrey
      Author
    • -
    • Campos Diego
      Author
    • +
    • Carrie Daymont
      Contributor, maintainer
    • +
    • Robert Grundmeier
      Author
    • +
    • Jeffrey Miller
      Author
    • +
    • Diego Campos
      Author
    • More about authors...
    @@ -230,12 +230,12 @@

    Dev status

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/news/index.html b/docs/news/index.html index 5d4b9f15..24e237f1 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -89,7 +89,18 @@

    Changelog

    - + +
    +

    Changed

    +
    • Fixed missing adult measurements to be labeled “Missing” in output (#119)
    • +
    • Added tests for missingness in adult output
    • +
    • Fixed missing “-RV” codes in adult output
    • +
    • Corrected contributor names in DESCRIPTION (#120)
    • +
    • Added email for Dan Chudnov in DESCRIPTION (#95)
    • +
    +
    +
    +

    Added

    • Use dependabot to update GitHub workflow action versions (#94)
    • @@ -98,7 +109,9 @@

      Added

      Changed

      • Updated ext_bmiz() to match Dec 2022 NCHS guidelines (#98)
      • -
      • New options to keep dates, columns, unmateched rows in longwide() (#71)
      • +
      • New options to keep dates, columns, unmatched rows in longwide() (#71)
      • +
      • Updated CITATION to match new CRAN requirements
      • +
      • Updated Dockerfile to build from repo, not CRAN

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 9fd7905a..050cf88a 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,5 +1,5 @@ -pandoc: 3.0.1 -pkgdown: 2.0.7 +pandoc: 2.19.2 +pkgdown: 2.0.6 pkgdown_sha: ~ articles: adult-algorithm: adult-algorithm.html @@ -12,5 +12,5 @@ articles: quickstart: quickstart.html usage: usage.html utilities: utilities.html -last_built: 2023-02-03T17:22Z +last_built: 2023-03-01T19:23Z diff --git a/docs/reference/CDCref_d.html b/docs/reference/CDCref_d.html index 398903db..30f6f334 100644 --- a/docs/reference/CDCref_d.html +++ b/docs/reference/CDCref_d.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -110,11 +110,11 @@

    CDCref_d.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/acf_answers.html b/docs/reference/acf_answers.html index 003bccb3..8dc5f03f 100644 --- a/docs/reference/acf_answers.html +++ b/docs/reference/acf_answers.html @@ -18,7 +18,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -183,11 +183,11 @@

    Value

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/adjustcarryforward.html b/docs/reference/adjustcarryforward.html index 7e05c3e5..0ff9dba4 100644 --- a/docs/reference/adjustcarryforward.html +++ b/docs/reference/adjustcarryforward.html @@ -23,7 +23,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -267,11 +267,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/bmianthro.html b/docs/reference/bmianthro.html index ebb705f0..145d9c1c 100644 --- a/docs/reference/bmianthro.html +++ b/docs/reference/bmianthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -114,11 +114,11 @@

    bmianthro.txt.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/cleangrowth.html b/docs/reference/cleangrowth.html index 958dca6c..a656dcdb 100644 --- a/docs/reference/cleangrowth.html +++ b/docs/reference/cleangrowth.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -315,10 +315,10 @@

    Examples

    measurement = df_stats$measurement, parallel = TRUE, num.batches = 2) -#> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’ -#> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’ -#> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’ -#> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’ +#> Warning: <anonymous>: ... may be used in an incorrect context: '.fun(piece, ...)' +#> Warning: <anonymous>: ... may be used in an incorrect context: '.fun(piece, ...)' +#> Warning: <anonymous>: ... may be used in an incorrect context: '.fun(piece, ...)' +#> Warning: <anonymous>: ... may be used in an incorrect context: '.fun(piece, ...)' # }
    @@ -330,11 +330,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/ewma.html b/docs/reference/ewma.html index f4cd4797..352b8424 100644 --- a/docs/reference/ewma.html +++ b/docs/reference/ewma.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -154,11 +154,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/ext_bmiz.html b/docs/reference/ext_bmiz.html index 6f85de5c..e0b27dce 100644 --- a/docs/reference/ext_bmiz.html +++ b/docs/reference/ext_bmiz.html @@ -22,7 +22,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -227,11 +227,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/growth_cdc_ext.html b/docs/reference/growth_cdc_ext.html index 3a99d834..1489be5a 100644 --- a/docs/reference/growth_cdc_ext.html +++ b/docs/reference/growth_cdc_ext.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -114,11 +114,11 @@

    growthfile_cdc_ext.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index 6ec1a596..87511d7d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -226,11 +226,11 @@

    Datasets

    pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/lenanthro.html b/docs/reference/lenanthro.html index df6ac34b..4d52ad47 100644 --- a/docs/reference/lenanthro.html +++ b/docs/reference/lenanthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -114,11 +114,11 @@

    lenanthro.txt.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/longwide.html b/docs/reference/longwide.html index e79b8a71..b7ff6764 100644 --- a/docs/reference/longwide.html +++ b/docs/reference/longwide.html @@ -19,7 +19,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -217,11 +217,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/nhanes-reference-medians.html b/docs/reference/nhanes-reference-medians.html index e40f3eb5..c71ec68a 100644 --- a/docs/reference/nhanes-reference-medians.html +++ b/docs/reference/nhanes-reference-medians.html @@ -18,7 +18,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -112,11 +112,11 @@

    nhanes-reference-medians.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/read_anthro.html b/docs/reference/read_anthro.html index 40b3998b..c1248c6c 100644 --- a/docs/reference/read_anthro.html +++ b/docs/reference/read_anthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -132,11 +132,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/recode_sex.html b/docs/reference/recode_sex.html index cda9197b..53db57c0 100644 --- a/docs/reference/recode_sex.html +++ b/docs/reference/recode_sex.html @@ -18,7 +18,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -167,11 +167,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/sd_median.html b/docs/reference/sd_median.html index dc7fb65d..8261b9b1 100644 --- a/docs/reference/sd_median.html +++ b/docs/reference/sd_median.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -151,11 +151,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/simple_bmi.html b/docs/reference/simple_bmi.html index 886cd157..fcd22b56 100644 --- a/docs/reference/simple_bmi.html +++ b/docs/reference/simple_bmi.html @@ -18,7 +18,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -151,11 +151,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/splitinput.html b/docs/reference/splitinput.html index d55d7f9a..e9c95b93 100644 --- a/docs/reference/splitinput.html +++ b/docs/reference/splitinput.html @@ -21,7 +21,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -169,11 +169,11 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/syngrowth.html b/docs/reference/syngrowth.html index 9fdc996c..cdc571cc 100644 --- a/docs/reference/syngrowth.html +++ b/docs/reference/syngrowth.html @@ -19,7 +19,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -119,11 +119,11 @@

    Details

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/tanner_ht_vel.html b/docs/reference/tanner_ht_vel.html index 535bccfb..e4924485 100644 --- a/docs/reference/tanner_ht_vel.html +++ b/docs/reference/tanner_ht_vel.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -114,11 +114,11 @@

    tanner_ht_vel.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/tanner_ht_vel_with_2sd.html b/docs/reference/tanner_ht_vel_with_2sd.html index 7451f5ad..6f312ffd 100644 --- a/docs/reference/tanner_ht_vel_with_2sd.html +++ b/docs/reference/tanner_ht_vel_with_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -115,11 +115,11 @@

    tanner_ht_vel_with_2sd.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/test_syngrowth_sas_output_compare.html b/docs/reference/test_syngrowth_sas_output_compare.html index 5c6b4113..eb0b3250 100644 --- a/docs/reference/test_syngrowth_sas_output_compare.html +++ b/docs/reference/test_syngrowth_sas_output_compare.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -110,11 +110,11 @@

    test_syngrowth_sas_output_compare.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/test_syngrowth_wide.html b/docs/reference/test_syngrowth_wide.html index 1bae0cc5..fe44fe53 100644 --- a/docs/reference/test_syngrowth_wide.html +++ b/docs/reference/test_syngrowth_wide.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -110,11 +110,11 @@

    test_syngrowth_wide.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/testacf.html b/docs/reference/testacf.html index 616fc880..2337cf60 100644 --- a/docs/reference/testacf.html +++ b/docs/reference/testacf.html @@ -20,7 +20,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -186,11 +186,11 @@

    Value

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/weianthro.html b/docs/reference/weianthro.html index 511a174b..752da891 100644 --- a/docs/reference/weianthro.html +++ b/docs/reference/weianthro.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -114,11 +114,11 @@

    weianthro.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/who_ht_maxvel.html b/docs/reference/who_ht_maxvel.html index 0500ed29..33debbce 100644 --- a/docs/reference/who_ht_maxvel.html +++ b/docs/reference/who_ht_maxvel.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -115,11 +115,11 @@

    who_ht_maxvel_3sd.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/who_ht_maxvel_2sd.html b/docs/reference/who_ht_maxvel_2sd.html index 4c06e08b..7b3a5707 100644 --- a/docs/reference/who_ht_maxvel_2sd.html +++ b/docs/reference/who_ht_maxvel_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -115,11 +115,11 @@

    who_ht_maxvel_2sd.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/who_ht_vel_2sd.html b/docs/reference/who_ht_vel_2sd.html index 062e7b64..78343789 100644 --- a/docs/reference/who_ht_vel_2sd.html +++ b/docs/reference/who_ht_vel_2sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -115,11 +115,11 @@

    who_ht_vel_2sd.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/who_ht_vel_3sd.html b/docs/reference/who_ht_vel_3sd.html index 6516e4d3..1337350b 100644 --- a/docs/reference/who_ht_vel_3sd.html +++ b/docs/reference/who_ht_vel_3sd.html @@ -17,7 +17,7 @@ growthcleanr - 2.1.0 + 2.1.1 @@ -115,11 +115,11 @@

    who_ht_vel_3sd.csv.gz

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index f6ccaf70..e2066ded 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -3,12 +3,6 @@ /404.html - - /LICENSE-text.html - - - /LICENSE.html - /articles/adult-algorithm.html @@ -49,10 +43,13 @@ /index.html - /news/index.html + /LICENSE-text.html - /reference/CDCref_d.html + /LICENSE.html + + + /news/index.html /reference/acf_answers.html @@ -63,6 +60,9 @@ /reference/bmianthro.html + + /reference/CDCref_d.html + /reference/cleangrowth.html @@ -115,13 +115,13 @@ /reference/tanner_ht_vel_with_2sd.html - /reference/test_syngrowth_sas_output_compare.html + /reference/testacf.html - /reference/test_syngrowth_wide.html + /reference/test_syngrowth_sas_output_compare.html - /reference/testacf.html + /reference/test_syngrowth_wide.html /reference/weianthro.html From 3ca3db59484bdeffc6fe8a05c4f9d2b58c8a3a6d Mon Sep 17 00:00:00 2001 From: "Dr. Hannah De los Santos" Date: Wed, 1 Mar 2023 15:17:05 -0500 Subject: [PATCH 66/67] Update pkgdown version --- docs/404.html | 2 +- docs/LICENSE-text.html | 2 +- docs/LICENSE.html | 2 +- docs/articles/adult-algorithm.html | 2 +- docs/articles/configuration.html | 2 +- docs/articles/developer-guidelines.html | 2 +- docs/articles/index.html | 2 +- docs/articles/installation.html | 2 +- docs/articles/large-data-sets.html | 2 +- docs/articles/next-steps.html | 2 +- docs/articles/output.html | 2 +- docs/articles/quickstart.html | 2 +- docs/articles/usage.html | 2 +- docs/articles/utilities.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 2 +- docs/pkgdown.yml | 4 ++-- docs/reference/CDCref_d.html | 2 +- docs/reference/acf_answers.html | 2 +- docs/reference/adjustcarryforward.html | 2 +- docs/reference/bmianthro.html | 2 +- docs/reference/cleangrowth.html | 2 +- docs/reference/ewma.html | 2 +- docs/reference/ext_bmiz.html | 2 +- docs/reference/growth_cdc_ext.html | 2 +- docs/reference/index.html | 2 +- docs/reference/lenanthro.html | 2 +- docs/reference/longwide.html | 2 +- docs/reference/nhanes-reference-medians.html | 2 +- docs/reference/read_anthro.html | 2 +- docs/reference/recode_sex.html | 2 +- docs/reference/sd_median.html | 2 +- docs/reference/simple_bmi.html | 2 +- docs/reference/splitinput.html | 2 +- docs/reference/syngrowth.html | 2 +- docs/reference/tanner_ht_vel.html | 2 +- docs/reference/tanner_ht_vel_with_2sd.html | 2 +- docs/reference/test_syngrowth_sas_output_compare.html | 2 +- docs/reference/test_syngrowth_wide.html | 2 +- docs/reference/testacf.html | 2 +- docs/reference/weianthro.html | 2 +- docs/reference/who_ht_maxvel.html | 2 +- docs/reference/who_ht_maxvel_2sd.html | 2 +- docs/reference/who_ht_vel_2sd.html | 2 +- docs/reference/who_ht_vel_3sd.html | 2 +- 46 files changed, 47 insertions(+), 47 deletions(-) diff --git a/docs/404.html b/docs/404.html index 4b745506..923920a9 100644 --- a/docs/404.html +++ b/docs/404.html @@ -133,7 +133,7 @@

    Page not found (404)

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 6f6bd6cd..844d06e4 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -106,7 +106,7 @@

    License

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 8b2cba29..252207b8 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -110,7 +110,7 @@

    MIT License

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/adult-algorithm.html b/docs/articles/adult-algorithm.html index a0fcb944..6064485b 100644 --- a/docs/articles/adult-algorithm.html +++ b/docs/articles/adult-algorithm.html @@ -840,7 +840,7 @@

    14H, 14W, Error load: Too-Many-Errors<

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/configuration.html b/docs/articles/configuration.html index da6ffe48..851055f8 100644 --- a/docs/articles/configuration.html +++ b/docs/articles/configuration.html @@ -368,7 +368,7 @@

    Derivation process

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/developer-guidelines.html b/docs/articles/developer-guidelines.html index e9da9cdc..7e9f14b1 100644 --- a/docs/articles/developer-guidelines.html +++ b/docs/articles/developer-guidelines.html @@ -174,7 +174,7 @@

    CRAN Release Checklist

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/index.html b/docs/articles/index.html index 14dc348b..1ced39cb 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -126,7 +126,7 @@

    Advanced

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/installation.html b/docs/articles/installation.html index 5c56c705..8b247d04 100644 --- a/docs/articles/installation.html +++ b/docs/articles/installation.html @@ -309,7 +309,7 @@

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/large-data-sets.html b/docs/articles/large-data-sets.html index 413e33e6..41aaff4f 100644 --- a/docs/articles/large-data-sets.html +++ b/docs/articles/large-data-sets.html @@ -336,7 +336,7 @@

    Reference for gcdriver.R

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/next-steps.html b/docs/articles/next-steps.html index c88f3564..c09830cb 100644 --- a/docs/articles/next-steps.html +++ b/docs/articles/next-steps.html @@ -519,7 +519,7 @@

    Error load

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/output.html b/docs/articles/output.html index 1fa07815..b49c4a31 100644 --- a/docs/articles/output.html +++ b/docs/articles/output.html @@ -549,7 +549,7 @@

    Exclusions generated by adult a

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/quickstart.html b/docs/articles/quickstart.html index afda3d87..00bcaa89 100644 --- a/docs/articles/quickstart.html +++ b/docs/articles/quickstart.html @@ -485,7 +485,7 @@

    Example

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/usage.html b/docs/articles/usage.html index abac1195..93b35999 100644 --- a/docs/articles/usage.html +++ b/docs/articles/usage.html @@ -306,7 +306,7 @@

    Basic configuration options

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/utilities.html b/docs/articles/utilities.html index 06d81a07..7fa80555 100644 --- a/docs/articles/utilities.html +++ b/docs/articles/utilities.html @@ -437,7 +437,7 @@

    Citation

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/index.html b/docs/index.html index bc38098c..ec278bf6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -235,7 +235,7 @@

    Dev status

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/news/index.html b/docs/news/index.html index 24e237f1..a480bfaa 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -326,7 +326,7 @@

    Added -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 050cf88a..f45aa4a7 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,5 +1,5 @@ pandoc: 2.19.2 -pkgdown: 2.0.6 +pkgdown: 2.0.7 pkgdown_sha: ~ articles: adult-algorithm: adult-algorithm.html @@ -12,5 +12,5 @@ articles: quickstart: quickstart.html usage: usage.html utilities: utilities.html -last_built: 2023-03-01T19:23Z +last_built: 2023-03-01T20:12Z diff --git a/docs/reference/CDCref_d.html b/docs/reference/CDCref_d.html index 30f6f334..25da7942 100644 --- a/docs/reference/CDCref_d.html +++ b/docs/reference/CDCref_d.html @@ -114,7 +114,7 @@

    CDCref_d.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/acf_answers.html b/docs/reference/acf_answers.html index 8dc5f03f..663e603b 100644 --- a/docs/reference/acf_answers.html +++ b/docs/reference/acf_answers.html @@ -187,7 +187,7 @@

    Value

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/adjustcarryforward.html b/docs/reference/adjustcarryforward.html index 0ff9dba4..87680c73 100644 --- a/docs/reference/adjustcarryforward.html +++ b/docs/reference/adjustcarryforward.html @@ -271,7 +271,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/bmianthro.html b/docs/reference/bmianthro.html index 145d9c1c..74319d28 100644 --- a/docs/reference/bmianthro.html +++ b/docs/reference/bmianthro.html @@ -118,7 +118,7 @@

    bmianthro.txt.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/cleangrowth.html b/docs/reference/cleangrowth.html index a656dcdb..d3257d47 100644 --- a/docs/reference/cleangrowth.html +++ b/docs/reference/cleangrowth.html @@ -334,7 +334,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/ewma.html b/docs/reference/ewma.html index 352b8424..3eb48c6a 100644 --- a/docs/reference/ewma.html +++ b/docs/reference/ewma.html @@ -158,7 +158,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/ext_bmiz.html b/docs/reference/ext_bmiz.html index e0b27dce..ae6d3bd6 100644 --- a/docs/reference/ext_bmiz.html +++ b/docs/reference/ext_bmiz.html @@ -231,7 +231,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/growth_cdc_ext.html b/docs/reference/growth_cdc_ext.html index 1489be5a..5f613c6d 100644 --- a/docs/reference/growth_cdc_ext.html +++ b/docs/reference/growth_cdc_ext.html @@ -118,7 +118,7 @@

    growthfile_cdc_ext.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index 87511d7d..a409c56f 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -230,7 +230,7 @@

    Datasets

    pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/lenanthro.html b/docs/reference/lenanthro.html index 4d52ad47..38a315b3 100644 --- a/docs/reference/lenanthro.html +++ b/docs/reference/lenanthro.html @@ -118,7 +118,7 @@

    lenanthro.txt.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/longwide.html b/docs/reference/longwide.html index b7ff6764..0909e9e3 100644 --- a/docs/reference/longwide.html +++ b/docs/reference/longwide.html @@ -221,7 +221,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/nhanes-reference-medians.html b/docs/reference/nhanes-reference-medians.html index c71ec68a..5c875b13 100644 --- a/docs/reference/nhanes-reference-medians.html +++ b/docs/reference/nhanes-reference-medians.html @@ -116,7 +116,7 @@

    nhanes-reference-medians.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/read_anthro.html b/docs/reference/read_anthro.html index c1248c6c..ea1a7669 100644 --- a/docs/reference/read_anthro.html +++ b/docs/reference/read_anthro.html @@ -136,7 +136,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/recode_sex.html b/docs/reference/recode_sex.html index 53db57c0..06f5b597 100644 --- a/docs/reference/recode_sex.html +++ b/docs/reference/recode_sex.html @@ -171,7 +171,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/sd_median.html b/docs/reference/sd_median.html index 8261b9b1..d3ef2ca5 100644 --- a/docs/reference/sd_median.html +++ b/docs/reference/sd_median.html @@ -155,7 +155,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/simple_bmi.html b/docs/reference/simple_bmi.html index fcd22b56..c04d2f53 100644 --- a/docs/reference/simple_bmi.html +++ b/docs/reference/simple_bmi.html @@ -155,7 +155,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/splitinput.html b/docs/reference/splitinput.html index e9c95b93..a5cd2398 100644 --- a/docs/reference/splitinput.html +++ b/docs/reference/splitinput.html @@ -173,7 +173,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/syngrowth.html b/docs/reference/syngrowth.html index cdc571cc..01b0c010 100644 --- a/docs/reference/syngrowth.html +++ b/docs/reference/syngrowth.html @@ -123,7 +123,7 @@

    Details

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/tanner_ht_vel.html b/docs/reference/tanner_ht_vel.html index e4924485..4a94e9ed 100644 --- a/docs/reference/tanner_ht_vel.html +++ b/docs/reference/tanner_ht_vel.html @@ -118,7 +118,7 @@

    tanner_ht_vel.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/tanner_ht_vel_with_2sd.html b/docs/reference/tanner_ht_vel_with_2sd.html index 6f312ffd..57afa61e 100644 --- a/docs/reference/tanner_ht_vel_with_2sd.html +++ b/docs/reference/tanner_ht_vel_with_2sd.html @@ -119,7 +119,7 @@

    tanner_ht_vel_with_2sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/test_syngrowth_sas_output_compare.html b/docs/reference/test_syngrowth_sas_output_compare.html index eb0b3250..742fa140 100644 --- a/docs/reference/test_syngrowth_sas_output_compare.html +++ b/docs/reference/test_syngrowth_sas_output_compare.html @@ -114,7 +114,7 @@

    test_syngrowth_sas_output_compare.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/test_syngrowth_wide.html b/docs/reference/test_syngrowth_wide.html index fe44fe53..b108b1bb 100644 --- a/docs/reference/test_syngrowth_wide.html +++ b/docs/reference/test_syngrowth_wide.html @@ -114,7 +114,7 @@

    test_syngrowth_wide.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/testacf.html b/docs/reference/testacf.html index 2337cf60..613eae99 100644 --- a/docs/reference/testacf.html +++ b/docs/reference/testacf.html @@ -190,7 +190,7 @@

    Value

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/weianthro.html b/docs/reference/weianthro.html index 752da891..e2ac4690 100644 --- a/docs/reference/weianthro.html +++ b/docs/reference/weianthro.html @@ -118,7 +118,7 @@

    weianthro.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/who_ht_maxvel.html b/docs/reference/who_ht_maxvel.html index 33debbce..47851509 100644 --- a/docs/reference/who_ht_maxvel.html +++ b/docs/reference/who_ht_maxvel.html @@ -119,7 +119,7 @@

    who_ht_maxvel_3sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/who_ht_maxvel_2sd.html b/docs/reference/who_ht_maxvel_2sd.html index 7b3a5707..abf89d3d 100644 --- a/docs/reference/who_ht_maxvel_2sd.html +++ b/docs/reference/who_ht_maxvel_2sd.html @@ -119,7 +119,7 @@

    who_ht_maxvel_2sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/who_ht_vel_2sd.html b/docs/reference/who_ht_vel_2sd.html index 78343789..35a0a069 100644 --- a/docs/reference/who_ht_vel_2sd.html +++ b/docs/reference/who_ht_vel_2sd.html @@ -119,7 +119,7 @@

    who_ht_vel_2sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/reference/who_ht_vel_3sd.html b/docs/reference/who_ht_vel_3sd.html index 1337350b..93b8969a 100644 --- a/docs/reference/who_ht_vel_3sd.html +++ b/docs/reference/who_ht_vel_3sd.html @@ -119,7 +119,7 @@

    who_ht_vel_3sd.csv.gz

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    From 7a7b6fb46114d214ce70389798195cfab00db620 Mon Sep 17 00:00:00 2001 From: Daniel Chudnov Date: Fri, 3 Mar 2023 10:34:25 -0500 Subject: [PATCH 67/67] Removed leading percent sign prompt indicator from vignettes, fixes #130 --- vignettes/installation.Rmd | 10 +++++----- vignettes/large-data-sets.Rmd | 2 +- vignettes/next-steps.Rmd | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vignettes/installation.Rmd b/vignettes/installation.Rmd index ddcdac67..11a823b7 100644 --- a/vignettes/installation.Rmd +++ b/vignettes/installation.Rmd @@ -96,7 +96,7 @@ To install and run `growthcleanr` using Docker, open the PowerShell on Windows, or open the Terminal on macOS, and enter this `docker` command: ```{bash, eval = FALSE} -% docker run -it ghcr.io/mitre/growthcleanr/gcr-image:latest R +docker run -it ghcr.io/mitre/growthcleanr/gcr-image:latest R ``` The image tag `latest` in the example above will refer to the latest version of @@ -109,7 +109,7 @@ To explicitly choose a release by name, replace `latest` with the release tag, e.g. for the released package `v2.1.0`: ```{bash, eval = FALSE} -% docker run -it ghcr.io/mitre/growthcleanr/gcr-image:v2.1.0 R +docker run -it ghcr.io/mitre/growthcleanr/gcr-image:v2.1.0 R ``` Whichever package you use, the first time this command is run, it might take a @@ -124,7 +124,7 @@ you are on Windows, and your data is in `C:\Users\exampleuser\analysis`, specify a mapping using the added `-v` step below: ```{bash, eval = FALSE} -% docker run -it -v C:\Users\exampleusers\analysis:/usr/src/app \ +docker run -it -v C:\Users\exampleusers\analysis:/usr/src/app \ ghcr.io/mitre/growthcleanr/gcr-image:latest R ``` @@ -141,7 +141,7 @@ If you are on macOS, and your data is in `/Users/exampleuser/analysis`, specify a folder mapping like this: ```{bash, eval = FALSE} -% docker run -it -v /Users/exampleuser/analysis:/usr/src/app \ +docker run -it -v /Users/exampleuser/analysis:/usr/src/app \ ghcr.io/mitre/growthcleanr/gcr-image:latest R ``` @@ -187,7 +187,7 @@ the `growthcleanr` source code and then install it from source. To clone the source using `git`: ```{bash, eval = FALSE} -% git clone https://github.com/carriedaymont/growthcleanr.git +git clone https://github.com/carriedaymont/growthcleanr.git ``` Once you have the `growthcleanr` package source, open an R session from the diff --git a/vignettes/large-data-sets.Rmd b/vignettes/large-data-sets.Rmd index 2ad67e13..321caba6 100644 --- a/vignettes/large-data-sets.Rmd +++ b/vignettes/large-data-sets.Rmd @@ -103,7 +103,7 @@ If you have many small files saved, for example, as `mydata.00001.csv`, `mydata.00002.csv`, etc., this driver can be invoked using `parallel`: ```{bash, eval = FALSE} -% ls mydata.?????.csv | parallel -j2 --eta \ +ls mydata.?????.csv | parallel -j2 --eta \ "Rscript exec/gcdriver.R --quietly --sdrecenter nhanes {} {}-clean.csv" ``` diff --git a/vignettes/next-steps.Rmd b/vignettes/next-steps.Rmd index 230b82b6..285fb4d0 100644 --- a/vignettes/next-steps.Rmd +++ b/vignettes/next-steps.Rmd @@ -28,7 +28,7 @@ file `R/adjustcarryforward.R`. It is separate from the main `R/growth.R` file as it is set up to be run separately, using the output from `cleangrowth()`. The `adjustcarryforward()` function is available in the main package namespace. -The primary tools for running this function are the script `exec/testadjustcf.R` and the function `testacf()`. +The primary tools for running this function are the script `exec/testadjustcf.R` and the function `testacf()`. These will run the experimental function on an existing dataset (specified as a CSV file or data frame) and pass it a sweep of parameter values for testing the new strategy. This tool will produce a combined output file or list that includes the original result @@ -51,7 +51,7 @@ directory; otherwise, make sure to specify the path relative to your current directory): ```bash -% Rscript exec/testadjustcf.R cleaned.csv +Rscript exec/testadjustcf.R cleaned.csv ``` To use `testacf()`, run the following in the console (with `cleaned_data` in the environment): @@ -188,7 +188,7 @@ and TIME are the system date and time. For the function, a list will be returned For example, a 5-step sweep with the `line-grid` search would be run with this command: ```bash -% Rscript exec/textadjustcf.R --gridlength 5 --searchtype line-grid cleaned.csv +Rscript exec/textadjustcf.R --gridlength 5 --searchtype line-grid cleaned.csv ``` or with this function execution: