do_heaping: Wrapper for Age-Heaping Methods

Description Usage Arguments See Also Examples

View source: R/HeapingMethods.R

Description

Wrapper for Age-Heaping Methods

Usage

1
2
3
4
5
6
7
do_heaping(
  X,
  fn = c("Whipple", "Myers", "Bachi", "CoaleLi", "Noumbissi", "Spoorenberg",
    "ageRatioScore", "KannistoHeap", "Jdanov"),
  verbose = TRUE,
  ...
)

Arguments

X

Input data. UN format.

fn

Method to be called from DemoTools. Available alternatives: "beers", "grabill", "sprague".

verbose

Logical value. If TRUE messages are printed as the method is applied. Set verbose = FALSE to silent the function.

...

Other arguments to be passed on to other methods and functions.

See Also

check_heaping_whipple, check_heaping_myers, check_heaping_bachi, check_heaping_coale_li, check_heaping_noumbissi, check_heaping_spoorenberg, ageRatioScore, check_heaping_kannisto, check_heaping_jdanov.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
P1 <- DDSQLtools.data$Pop1_Egypt_M_DB

H1 <- do_heaping(P1, fn = "Whipple")
H2 <- do_heaping(P1, fn = "Myers")
H3 <- do_heaping(P1, fn = "Bachi")
H4 <- do_heaping(P1, fn = "CoaleLi")
H5 <- do_heaping(P1, fn = "Noumbissi")
H6 <- do_heaping(P1, fn = "Spoorenberg")
H7 <- do_heaping(P1, fn = "ageRatioScore")
H8 <- do_heaping(P1, fn = "KannistoHeap")
H9 <- do_heaping(P1, fn = "Jdanov")

H <- rbind(H1, H2, H3, H4, H5, H6, H7, H8, H9)
select_columns <- c("AgeID", "AgeStart", "AgeMid", "AgeEnd", "AgeLabel",
                    "DataTypeName", "DataTypeID", "DataValue")
H[, select_columns]

# Silence the function with verbose = FALSE
H1 <- do_heaping(P1, fn = "Whipple", verbose = FALSE)
# ... or by specifying all arguments
H1 <- do_heaping(P1, fn = "Whipple", ageMin = 10, ageMax = 90, digit = 1)

timriffe/DDSQLtools documentation built on Oct. 6, 2021, 5:34 p.m.