-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathui_flow_control_smoothing.R
More file actions
48 lines (24 loc) · 1.33 KB
/
ui_flow_control_smoothing.R
File metadata and controls
48 lines (24 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# This script in progress, pending some directions
devtools::load_all()
library(dplyr)
data_in <- readr::read_csv(system.file("extdata",
"abridged_hmd_spain.csv.gz",
package="ODAPbackend"))
# standard checks run before doing the thing.
initial_data_checks <- check_data(data_in)
initial_data_checks
head(data_in) # has .id column
# Here explicitly we return the same age groups
# used in the input data.
output <- smooth_flexible(data_in,
variable = "Deaths", # user specifies this
age_out = "single", # always use this: not a user choice
fine_method = "sprague", # user specifies from list (see below),
rough_method = "none", # always use this: not a user choice
constrain_infants = TRUE, # in case abridged age 0 should be maintained as-is
Sex = "t", # If this is given as columnin the data, then it's detected.
# Otherwise user should specify.
by_args = NULL, # can be ignored if .id present; don't include Sex here.
# in ui this is handled earlier in group definitions
i18n = NULL # ui arg
)