do_splitting: Wrapper for Age-Splitting Methods

Description Usage Arguments Value See Also Examples

View source: R/SplittingMethods.R

Description

Wrapper for Age-Splitting Methods

Usage

1
do_splitting(X, fn = c("beers", "grabill", "sprague"), 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.

Value

A data.frame having the same number of columns as input data. Different numbers of rows. UN format.

See Also

graduate_beers, graduate_grabill, graduate_sprague.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Example 1 --- Abridged data
P5 <- DDSQLtools.data$Pop5_Egypt_M_DB

W1 <- do_splitting(P5, fn = "beers")
W2 <- do_splitting(P5, fn = "grabill")
W3 <- do_splitting(P5, fn = "sprague")

# Example 2 --- 1-year age groups
P1 <- DDSQLtools.data$Pop1_Egypt_M_DB

V1 <- do_splitting(P1, fn = "beers")
V2 <- do_splitting(P1, fn = "grabill")
V3 <- do_splitting(P1, fn = "sprague")

select_columns <- c("AgeID", "AgeStart", "AgeMid", "AgeEnd", "AgeLabel",
                    "DataTypeName", "DataTypeID", "DataValue")

W1[, select_columns]
V1[, select_columns]

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