Skip to content

Commit

Permalink
Merge pull request #77 from mitre/cran-upd
Browse files Browse the repository at this point in the history
Make updates in preparation for CRAN
  • Loading branch information
delosh653 authored Jul 25, 2022
2 parents c24f289 + 6da253d commit 6f13718
Show file tree
Hide file tree
Showing 78 changed files with 2,374 additions and 93,202 deletions.
32 changes: 23 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
Package: growthcleanr
Type: Package
Title: Growth Measurements Cleaner
Version: 2.0.0
Title: Data Cleaner for Anthropometric Measurements
Version: 2.0.1
Authors@R: c(
person("Daymont","Carrie",,"[email protected]",c("aut","cre")),
person("Grundmeier","Robert",,"[email protected]","aut"),
person("Miller","Jeffrey",,"[email protected]","aut"),
person("Campos","Diego",,"[email protected]","aut")
person("Daymont","Carrie", email = "[email protected]", role = "aut"),
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 = "[email protected]", role = c("ctb","cre")),
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")
)
Maintainer: Robert Grundmeier <[email protected]>
Description: growthcleanr cleans growth data that may contain implausible data based on unit or data range.
Description: ‘growthcleanr’ identifies implausible anthropometric (e.g., height,
weight) measurements in irregularly spaced longitudinal datasets, such as those from electronic health records.
URL: https://carriedaymont.github.io/growthcleanr/index.html, https://github.com/carriedaymont/growthcleanr
BugReports: https://github.com/carriedaymont/growthcleanr/issues
Imports:
R.utils (>= 2.11.0),
data.table (>= 1.13.0),
tidyr (>= 1.1.0),
plyr (>= 1.8.6),
Expand All @@ -24,7 +38,6 @@ Depends:
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
Roxygen: list(markdown = TRUE)
Suggests:
argparser (>= 0.6),
Expand All @@ -33,3 +46,4 @@ Suggests:
rmarkdown (>= 2.3),
testthat (>= 2.3.2)
VignetteBuilder: knitr
RoxygenNote: 7.2.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2021 Carrie Daymont
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
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export(sd_median)
export(simple_bmi)
export(splitinput)
export(testacf)
import(R.utils, except = c(extract))
import(data.table)
import(doParallel)
import(dplyr, except = c(last, first, summarize, src, between))
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# growthcleanr 2.0.1 - 2021-07-21

## Changed

- Updated DESCRIPTION, including authors, URLS, title, description, and imports
- Compressed files in `inst/extdata` for size requirements; added `R.utils` as
import to support `fread()` for `.gz` files
- Updated license year

# growthcleanr 2.0.0 - 2021-06-30

## Added
Expand Down
39 changes: 19 additions & 20 deletions R/adjustcarryforward.R
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ calc_step_15_no_param <- function(
#' @rawNamespace import(plyr, except = c(failwith, id, summarize, count, desc, mutate, arrange, rename, is.discrete, summarise, summarize))
#' @rawNamespace import(dplyr, except = c(last, first, summarize, src, between))
#' @import data.table
#' @rawNamespace import(R.utils, except = c(extract))
# NOTE: no examples, since this is a temporary function
acf_answers <- function(subjid,
param,
Expand Down Expand Up @@ -805,8 +806,8 @@ acf_answers <- function(subjid,
# recode column names to match syntactic style ("." rather than "_" in variable names)
tanner_ht_vel_path <- ifelse(
ref.data.path == "",
system.file("extdata/tanner_ht_vel.csv", package = "growthcleanr"),
paste(ref.data.path, "tanner_ht_vel.csv", sep =
system.file("extdata/tanner_ht_vel.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "tanner_ht_vel.csv.gz", sep =
"")
)
tanner.ht.vel <- fread(tanner_ht_vel_path)
Expand All @@ -821,15 +822,15 @@ acf_answers <- function(subjid,

who_max_ht_vel_path <- ifelse(
ref.data.path == "",
system.file("extdata/who_ht_maxvel_3sd.csv", package = "growthcleanr"),
paste(ref.data.path, "who_ht_maxvel_3sd.csv", sep =
system.file("extdata/who_ht_maxvel_3sd.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "who_ht_maxvel_3sd.csv.gz", sep =
"")
)

who_ht_vel_3sd_path <- ifelse(
ref.data.path == "",
system.file("extdata/who_ht_vel_3sd.csv", package = "growthcleanr"),
paste(ref.data.path, "who_ht_vel_3sd.csv", sep =
system.file("extdata/who_ht_vel_3sd.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "who_ht_vel_3sd.csv.gz", sep =
"")
)
who.max.ht.vel <- fread(who_max_ht_vel_path)
Expand All @@ -851,9 +852,8 @@ acf_answers <- function(subjid,
# recode column names to match syntactic style ("." rather than "_" in variable names)
tanner_ht_vel_2sd_path <- ifelse(
ref.data.path == "",
system.file("extdata/tanner_ht_vel_with_2sd.csv", package = "growthcleanr"),
paste(ref.data.path, "tanner_ht_vel_with_2sd.csv", sep =
"")
system.file("extdata/tanner_ht_vel_with_2sd.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "tanner_ht_vel_with_2sd.csv.gz", sep = "")
)
tanner.ht.vel.2sd <- fread(tanner_ht_vel_2sd_path)

Expand All @@ -868,15 +868,15 @@ acf_answers <- function(subjid,

who_max_ht_vel_2sd_path <- ifelse(
ref.data.path == "",
system.file("extdata/who_ht_maxvel_2sd.csv", package = "growthcleanr"),
paste(ref.data.path, "who_ht_maxvel_2sd.csv", sep =
system.file("extdata/who_ht_maxvel_2sd.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "who_ht_maxvel_2sd.csv.gz", sep =
"")
)

who_ht_vel_2sd_path <- ifelse(
ref.data.path == "",
system.file("extdata/who_ht_vel_2sd.csv", package = "growthcleanr"),
paste(ref.data.path, "who_ht_vel_2sd.csv", sep =
system.file("extdata/who_ht_vel_2sd.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "who_ht_vel_2sd.csv.gz", sep =
"")
)
who.max.ht.vel.2sd <- fread(who_max_ht_vel_2sd_path)
Expand Down Expand Up @@ -1226,9 +1226,8 @@ adjustcarryforward <- function(subjid,
# recode column names to match syntactic style ("." rather than "_" in variable names)
tanner_ht_vel_path <- ifelse(
ref.data.path == "",
system.file("extdata/tanner_ht_vel.csv", package = "growthcleanr"),
paste(ref.data.path, "tanner_ht_vel.csv", sep =
"")
system.file("extdata/tanner_ht_vel.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "tanner_ht_vel.csv.gz", sep = "")
)

tanner.ht.vel <- fread(tanner_ht_vel_path)
Expand All @@ -1243,15 +1242,15 @@ adjustcarryforward <- function(subjid,

who_max_ht_vel_path <- ifelse(
ref.data.path == "",
system.file("extdata/who_ht_maxvel_3sd.csv", package = "growthcleanr"),
paste(ref.data.path, "who_ht_maxvel_3sd.csv", sep =
system.file("extdata/who_ht_maxvel_3sd.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "who_ht_maxvel_3sd.csv.gz", sep =
"")
)

who_ht_vel_3sd_path <- ifelse(
ref.data.path == "",
system.file("extdata/who_ht_vel_3sd.csv", package = "growthcleanr"),
paste(ref.data.path, "who_ht_vel_3sd.csv", sep =
system.file("extdata/who_ht_vel_3sd.csv.gz", package = "growthcleanr"),
paste(ref.data.path, "who_ht_vel_3sd.csv.gz", sep =
"")
)
who.max.ht.vel <- fread(who_max_ht_vel_path)
Expand Down
7 changes: 4 additions & 3 deletions R/cdc.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set_cols_first <- function(DT, cols, intersection = TRUE)
}
}

#' Calculate extended BMI measures
#' Calculate extended BMI measures
#'
#' \code{ext_bmiz} Calculates the sigma (scale parameter for the half-normal
#' distribution), extended BMI percentile, extended BMIz, and the CDC LMS
Expand Down Expand Up @@ -101,6 +101,7 @@ set_cols_first <- function(DT, cols, intersection = TRUE)
#' @import labelled
#' @import magrittr
#' @importFrom stats approx pnorm qnorm
#' @rawNamespace import(R.utils, except = c(extract))
#' @examples
#' # Run on a small subset of given data
#' df <- as.data.frame(syngrowth)
Expand Down Expand Up @@ -166,8 +167,8 @@ ext_bmiz <- function(data,

dref_path <- ifelse(
ref.data.path == "",
system.file("extdata/CDCref_d.csv", package = "growthcleanr"),
paste(ref.data.path, "CDCref_d.csv", 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
Expand Down
41 changes: 27 additions & 14 deletions R/extdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#'
#' @name bmianthro
#'
#' @section bmianthro.txt:
#' @section bmianthro.txt.gz:
#'
#' Used in function `cleangrowth()`
#'
Expand All @@ -21,7 +21,7 @@ NULL
#'
#' @name growth_cdc_ext
#'
#' @section growthfile_cdc_ext.csv:
#' @section growthfile_cdc_ext.csv.gz:
#'
#' Used in function `cleangrowth()`
#'
Expand All @@ -36,7 +36,7 @@ NULL
#'
#' @name lenanthro
#'
#' @section lenanthro.txt:
#' @section lenanthro.txt.gz:
#'
#' Used in function `cleangrowth()`
#'
Expand All @@ -50,7 +50,7 @@ NULL
#'
#' @name nhanes-reference-medians
#'
#' @section nhanes-reference-medians.csv:
#' @section nhanes-reference-medians.csv.gz:
#'
#' Used in function `cleangrowth()`
#'
Expand All @@ -65,7 +65,7 @@ NULL
#'
#' @name tanner_ht_vel
#'
#' @section tanner_ht_vel.csv:
#' @section tanner_ht_vel.csv.gz:
#'
#' Used in function `cleangrowth()`
#'
Expand All @@ -79,9 +79,9 @@ NULL
#' Contains velocities for growth pre-calculated by CDC, including those 2
#' standard deviations away.
#'
#' @name tanner_ht_vel_2sd
#' @name tanner_ht_vel_with_2sd
#'
#' @section tanner_ht_vel.csv:
#' @section tanner_ht_vel_with_2sd.csv.gz:
#'
#' Used in function `acf_answers()`
#'
Expand All @@ -96,7 +96,7 @@ NULL
#'
#' @name weianthro
#'
#' @section weianthro.csv:
#' @section weianthro.csv.gz:
#'
#' Used in function `cleangrowth()`
#'
Expand All @@ -112,7 +112,7 @@ NULL
#'
#' @name who_ht_maxvel
#'
#' @section who_ht_maxvel_3sd.csv:
#' @section who_ht_maxvel_3sd.csv.gz:
#'
#' Used in function `cleangrowth()`
#'
Expand All @@ -128,7 +128,7 @@ NULL
#'
#' @name who_ht_maxvel_2sd
#'
#' @section who_ht_maxvel_2sd.csv:
#' @section who_ht_maxvel_2sd.csv.gz:
#'
#' Used in function `acf_answers()`
#'
Expand All @@ -144,7 +144,7 @@ NULL
#'
#' @name who_ht_vel_3sd
#'
#' @section who_ht_vel_3sd.csv:
#' @section who_ht_vel_3sd.csv.gz:
#'
#' Used in function `cleangrowth()`
#'
Expand All @@ -160,7 +160,7 @@ NULL
#'
#' @name who_ht_vel_2sd
#'
#' @section who_ht_vel_2sd.csv:
#' @section who_ht_vel_2sd.csv.gz:
#'
#' Used in function `acf_answers()`
#'
Expand All @@ -173,7 +173,7 @@ NULL
#'
#' @name test_syngrowth_wide
#'
#' @section test_syngrowth_wide.csv:
#' @section test_syngrowth_wide.csv.gz:
#'
#' Used to test function `ext_bmiz()`
#'
Expand All @@ -186,9 +186,22 @@ NULL
#'
#' @name test_syngrowth_sas_output_compare
#'
#' @section test_syngrowth_sas_output_compare.csv:
#' @section test_syngrowth_sas_output_compare.csv.gz:
#'
#' Used to test function `ext_bmiz()`
#'
#'
NULL

#' CDC BMI reference data
#'
#' Used for extended BMIz computation
#'
#' @name CDCref_d
#'
#' @section CDCref_d.csv.gz:
#'
#' Used for extended BMI computation
#'
#'
NULL
Loading

0 comments on commit 6f13718

Please sign in to comment.