Skip to content

Commit 42e8843

Browse files
committed
Replaces "Duplicates" with "Extraneous-Same-Day" in exclusion names and code references to "duplicate[s]", closes mitre#15
1 parent 1ded5e3 commit 42e8843

File tree

6 files changed

+175
-175
lines changed

6 files changed

+175
-175
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Authors@R: c(
99
person("Campos","Diego",,"camposd@email.chop.edu","aut")
1010
)
1111
Maintainer: Robert Grundmeier <grundmeier@email.chop.edu>
12-
Description: Cleans growth data that may contain implausible data based on unit or data range
12+
Description: growthcleanr cleans growth data that may contain implausible data based on unit or data range.
1313
Imports:
1414
data.table (>= 1.13.0),
1515
tidyr (>= 1.1.0),

R/growth.R

Lines changed: 126 additions & 126 deletions
Large diffs are not rendered by default.

README-adjustcarryforward.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ parameters).
9292
* Warning: this will take much longer!
9393

9494
The default number of sweep steps is 9; this can be changed with the option
95-
`--gridlength`.
95+
`--gridlength`.
9696

9797
For testing options of handling strings of multiple carried forward
98-
values, several options from 0 to 3 have been incorporated. 0 (no change) is the
99-
default option, and can be changed `--exclude_opt`. More information on each
98+
values, several options from 0 to 3 have been incorporated. 0 (no change) is the
99+
default option, and can be changed `--exclude_opt`. More information on each
100100
option can be found in the `adjustcarryforward()` documentation.
101101

102102
In addition to multiple options for carried-forward strings, "answers" for a given
103-
dataset have been incorporated. When the `--add_answers` flag is set to `TRUE`
103+
dataset have been incorporated. When the `--add_answers` flag is set to `TRUE`
104104
(`TRUE` by default), a column called `acf_answers` will have, for each height value, "Definitely Exclude", "Definitely Include", or "Unknown" (if it does not fall in
105105
either category). Weight values are set as `NA`.
106106

@@ -180,16 +180,16 @@ sweep (hence the examples w/5 and 9 step sweeps).
180180
And the first few result rows in `test_adjustcarrforward_DATE_TIME.csv` would be:
181181

182182
```R
183-
id subjid sex agedays param measurement clean_value run-1 run-2 run-3 run-4 run-5
184-
1510 775155 0 889 HEIGHTCM 84.9 Exclude-Duplicate Missing Missing Missing Missing Missing
185-
1511 775155 0 889 HEIGHTCM 89.06 Include No Change No Change No Change No Change No Change
186-
1512 775155 0 1071 HEIGHTCM 92.5 Include No Change No Change No Change No Change No Change
187-
1513 775155 0 1253 HEIGHTCM 96.2 Include No Change No Change No Change No Change No Change
188-
1514 775155 0 1435 HEIGHTCM 96.2 Exclude-Carried-Forward No Change No Change Include Include Include
189-
1515 775155 0 1435 HEIGHTCM 99.692 Include No Change No Change No Change No Change No Change
190-
1516 775155 0 1806 HEIGHTCM 106.1 Include No Change No Change No Change No Change No Change
191-
1517 775155 0 2177 HEIGHTCM 112.3 Include No Change No Change No Change No Change No Change
192-
1518 775155 0 889 WEIGHTKG 13.1 Include No Change No Change No Change No Change No Change
183+
id subjid sex agedays param measurement clean_value run-1 run-2 run-3 run-4 run-5
184+
1510 775155 0 889 HEIGHTCM 84.9 Exclude-Extraneous-Same-Day Missing Missing Missing Missing Missing
185+
1511 775155 0 889 HEIGHTCM 89.06 Include No Change No Change No Change No Change No Change
186+
1512 775155 0 1071 HEIGHTCM 92.5 Include No Change No Change No Change No Change No Change
187+
1513 775155 0 1253 HEIGHTCM 96.2 Include No Change No Change No Change No Change No Change
188+
1514 775155 0 1435 HEIGHTCM 96.2 Exclude-Carried-Forward No Change No Change Include Include Include
189+
1515 775155 0 1435 HEIGHTCM 99.692 Include No Change No Change No Change No Change No Change
190+
1516 775155 0 1806 HEIGHTCM 106.1 Include No Change No Change No Change No Change No Change
191+
1517 775155 0 2177 HEIGHTCM 112.3 Include No Change No Change No Change No Change No Change
192+
1518 775155 0 889 WEIGHTKG 13.1 Include No Change No Change No Change No Change No Change
193193
```
194194

195195
The fifth row in the example above demonstrates the results of the experimental script;

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -378,31 +378,31 @@ with `cleangrowth()` will likely take a few minutes to complete.
378378
> setkey(data, subjid, param, agedays)
379379
> cleaned_data <- data[, clean_value:=cleangrowth(subjid, param, agedays, sex, measurement)]
380380
> head(cleaned_data)
381-
id subjid sex agedays param measurement clean_value
382-
1: 1510 775155 0 889 HEIGHTCM 84.900 Exclude-Duplicate
383-
2: 1511 775155 0 889 HEIGHTCM 89.060 Include
384-
3: 1512 775155 0 1071 HEIGHTCM 92.500 Include
385-
4: 1513 775155 0 1253 HEIGHTCM 96.200 Include
386-
5: 1514 775155 0 1435 HEIGHTCM 96.200 Exclude-Carried-Forward
387-
6: 1515 775155 0 1435 HEIGHTCM 99.692 Include
381+
id subjid sex agedays param measurement clean_value
382+
1: 1510 775155 0 889 HEIGHTCM 84.900 Exclude-Extraneous-Same-Day
383+
2: 1511 775155 0 889 HEIGHTCM 89.060 Include
384+
3: 1512 775155 0 1071 HEIGHTCM 92.500 Include
385+
4: 1513 775155 0 1253 HEIGHTCM 96.200 Include
386+
5: 1514 775155 0 1435 HEIGHTCM 96.200 Exclude-Carried-Forward
387+
6: 1515 775155 0 1435 HEIGHTCM 99.692 Include
388388
> cleaned_data %>% group_by(clean_value) %>% tally(sort=TRUE)
389389
# A tibble: 14 x 2
390-
clean_value n
391-
<ord> <int>
392-
1 Include 38875
393-
2 Exclude-Duplicate 10546
394-
3 Exclude-Carried-Forward 6694
395-
4 Exclude-SD-Cutoff 168
396-
5 Exclude-EWMA-8 135
397-
6 Exclude-EWMA-Extreme 95
398-
7 Exclude-EWMA-9 93
399-
8 Exclude-Min-Height-Change 65
400-
9 Swapped-Measurements 16
401-
10 Exclude-Too-Many-Errors 6
402-
11 Exclude-EWMA-11 5
403-
12 Exclude-EWMA-12 2
404-
13 Exclude-Pair-Delta-18 2
405-
14 Exclude-Max-Height-Change 1
390+
clean_value n
391+
<ord> <int>
392+
1 Include 38875
393+
2 Exclude-Extraneous-Same-Day 10546
394+
3 Exclude-Carried-Forward 6694
395+
4 Exclude-SD-Cutoff 168
396+
5 Exclude-EWMA-8 135
397+
6 Exclude-EWMA-Extreme 95
398+
7 Exclude-EWMA-9 93
399+
8 Exclude-Min-Height-Change 65
400+
9 Swapped-Measurements 16
401+
10 Exclude-Too-Many-Errors 6
402+
11 Exclude-EWMA-11 5
403+
12 Exclude-EWMA-12 2
404+
13 Exclude-Pair-Delta-18 2
405+
14 Exclude-Max-Height-Change 1
406406
```
407407

408408
If you are able to run these steps and see a similar result, you have the
@@ -596,7 +596,7 @@ the algorithm's step labels and labels used in comment text in `growthcleanr`.
596596
| - | - | - | - |
597597
| 2d | 0 | Include | - |
598598
| 2d | 1 | Missing | - |
599-
| 5b | 2 | Exclude-Temporary-Duplicate | - |
599+
| 5b | 2 | Exclude-Temporary-Extraneous-Same-Day | - |
600600
| 7d | - | Swapped-Measurement | - |
601601
| 8f | - | Unit-Error-High | - |
602602
| 8f | - | Unit-Error-Low | - |
@@ -605,7 +605,7 @@ the algorithm's step labels and labels used in comment text in `growthcleanr`.
605605
| 10c | 4 | Exclude-SD-Cutoff | 10d, 10e |
606606
| 11d | 5 | Exclude-EWMA-Extreme | 11e |
607607
| 11f.ii | 6 | Exclude-EWMA-Extreme-Pair | 11i (R only) |
608-
| 12d.i | 7 | Exclude-Duplicate | 12diii, 12ei, 12f |
608+
| 12d.i | 7 | Exclude-Extraneous-Same-Day | 12diii, 12ei, 12f |
609609
| 14f.i | 8 | Exclude-EWMA-8 | Set in 14h (in R) |
610610
| 14f.ii | 9 | Exclude-EWMA-9 | Set in 14h (in R) |
611611
| 14f.iii | 10 | Exclude-EWMA-10 | Set in 14h (in R) |
@@ -826,13 +826,13 @@ parameter type as `type`, specify each, with quotes:
826826

827827
```R
828828
> head(my_cleaned_data)
829-
id subjid sex aged type measurement clean_value
830-
1: 1510 775155 0 889 HEIGHTCM 84.90 Exclude-Duplicate
831-
2: 1511 775155 0 889 HEIGHTCM 89.06 Include
832-
3: 1518 775155 0 889 WEIGHTKG 13.10 Include
833-
4: 1512 775155 0 1071 HEIGHTCM 92.50 Include
834-
5: 1519 775155 0 1071 WEIGHTKG 14.70 Include
835-
6: 1513 775155 0 1253 HEIGHTCM 96.20 Include
829+
id subjid sex aged type measurement clean_value
830+
1: 1510 775155 0 889 HEIGHTCM 84.90 Exclude-Extraneous-Same-Day
831+
2: 1511 775155 0 889 HEIGHTCM 89.06 Include
832+
3: 1518 775155 0 889 WEIGHTKG 13.10 Include
833+
4: 1512 775155 0 1071 HEIGHTCM 92.50 Include
834+
5: 1519 775155 0 1071 WEIGHTKG 14.70 Include
835+
6: 1513 775155 0 1253 HEIGHTCM 96.20 Include
836836
> longwide(my_cleaned_data, agedays="aged", param="type")
837837
```
838838

man/cleangrowth.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ test_that("longwide works as expected with custom values", {
340340
# run longwide on changed data with some exclusion types included
341341
inc_types <- c("Include",
342342
"Exclude-Carried-Forward",
343-
"Exclude-Duplicate")
343+
"Exclude-Extraneous-Same-Day")
344344
wide_syn <- longwide(sub_syn,
345345
clean_value = "cv",
346346
inclusion_types = inc_types)

0 commit comments

Comments
 (0)