get_info_tidy: tidy up incidence outputs

Description Usage Arguments Value Functions Examples

View source: R/tidy01.R

Description

functions to get tibble outputs from incidence package

Usage

1
2
3
4
5
get_info_tidy(incidence_fit, what)

tidy_incidence(incidence_fit)

glance_incidence(incidence_fit)

Arguments

incidence_fit

incidence_fit or incidence_fit_list object

what

character string of parameter of interest

Value

incidence tibbles!

Functions

Examples

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# example outbreak --------------------------------------------------------

library(outbreaks) #sample data
library(incidence) #core functions
# library(avallecam) #improvements
dat <- ebola_sim$linelist$date_of_onset
i.7 <- incidence(dat, interval=7)
# plot(i.7)
f1 <- fit(i.7[1:20])
# f1
f2 <- fit_optim_split(i.7)
# f2

# get_info_tidy: tibble outputs from fit object ---------------------------

# original
get_info(f1,what = "r")

# new improvement
get_info_tidy(f1,what = "r")

# for incidence::fit_optim_split outputs use .$fit

# original
get_info(f2$fit, what = "r")

#improvement
get_info_tidy(f2$fit, what = "r")

# try more examples:

# get_info(f2$fit, what = "r.conf")
# get_info_tidy(f2$fit, what = "r.conf")
# get_info_tidy(f2$fit, what = "doubling")
# get_info_tidy(f2$fit, what = "doubling.conf")
# get_info_tidy(f2$fit, what = "halving")
# get_info_tidy(f2$fit, what = "halving.conf")

# tidy_incidence: all key parameters in tibble ----------------------------

tidy_incidence(incidence_fit = f1)
tidy_incidence(incidence_fit = f2$fit)

# glance_incidence: check model performance -------------------------------

glance_incidence(incidence_fit = f1)
glance_incidence(incidence_fit = f2$fit)

avallecam/incidenceflow documentation built on July 9, 2021, 12:04 p.m.