Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion vignettes/conmat-population.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ vignette: >
---

```{r, include = FALSE}
all_times <- list() # store the time for each chunk
knitr::knit_hooks$set(time_it = local({
now <- NULL
function(before, options) {
if (before) {
now <<- Sys.time()
} else {
res <- difftime(Sys.time(), now)
all_times[[options$label]] <<- res
}
}
}))
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
comment = "#>",
time_it = TRUE
)
```

Expand Down Expand Up @@ -212,3 +225,8 @@ If you want to use `conmat_population` within your R package, then please get in
# Conclusion

That's how we can use the conmat population information! Please go ahead and use and enjoy!

```{r}
all_times
```

20 changes: 19 additions & 1 deletion vignettes/data-sources.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ vignette: >
---

```{r, include = FALSE}
all_times <- list() # store the time for each chunk
knitr::knit_hooks$set(time_it = local({
now <- NULL
function(before, options) {
if (before) {
now <<- Sys.time()
} else {
res <- difftime(Sys.time(), now)
all_times[[options$label]] <<- res
}
}
}))
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
comment = "#>",
time_it = TRUE
)
```

Expand Down Expand Up @@ -203,3 +216,8 @@ eyre_transmission_probabilities %>%
axis.text = element_text(angle = 45, hjust = 1)
)
```

```{r}
all_times
```

20 changes: 19 additions & 1 deletion vignettes/example-pipeline.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ vignette: >
---

```{r, include = FALSE}
all_times <- list() # store the time for each chunk
knitr::knit_hooks$set(time_it = local({
now <- NULL
function(before, options) {
if (before) {
now <<- Sys.time()
} else {
res <- difftime(Sys.time(), now)
all_times[[options$label]] <<- res
}
}
}))
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
comment = "#>",
time_it = TRUE
)
```

Expand Down Expand Up @@ -268,3 +281,8 @@ This is a bit briefer than the two step process, and might be preferable to crea
<!-- The initial phase of COVID-19 pandemic saw a significant age dependence in the distribution of confirmed cases with fewer confirmed cases among children. This might have been a result of younger ages being less susceptible to infection and/or less likely to exhibit clinical signs when infected [ [Davies et al](https://www.nature.com/articles/s41591-020-0962-9)] . A population's clinical fraction and age-varying susceptibility to infection both profoundly influence the likelihood that an infectious agent would spread there. This likelihood that an infectious agent would spread from an infected source to a new susceptible host and infect the host is known as transmission probability. -->

<!-- The age and setting specific relative per-contact transmission probability matrices when combined with contact matrices could be used to produce the setting-specific relative next generation matrices (NGMs) which is used to obtain the distribution of numbers of new cases in each generation of infection from any arbitrary initial number of introduced infections. Conmat creates these age and setting specific relative per-contact transmission probability matrices through `get_setting_transmission_matrices()` by making use of clinical fraction and relative susceptibility parameters from Davies et al available through `davies_age_extended`. -->

```{r}
all_times
```

20 changes: 19 additions & 1 deletion vignettes/getting-started.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ vignette: >
---

```{r, include = FALSE}
all_times <- list() # store the time for each chunk
knitr::knit_hooks$set(time_it = local({
now <- NULL
function(before, options) {
if (before) {
now <<- Sys.time()
} else {
res <- difftime(Sys.time(), now)
all_times[[options$label]] <<- res
}
}
}))
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
comment = "#>",
time_it = TRUE
)
```

Expand Down Expand Up @@ -310,3 +323,8 @@ autoplot(
title = "Setting-specific synthetic contact matrices (fairfield 2020 projected)"
)
```

```{r}
all_times
```

20 changes: 19 additions & 1 deletion vignettes/other-data-sources.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ vignette: >
---

```{r, include = FALSE}
all_times <- list() # store the time for each chunk
knitr::knit_hooks$set(time_it = local({
now <- NULL
function(before, options) {
if (before) {
now <<- Sys.time()
} else {
res <- difftime(Sys.time(), now)
all_times[[options$label]] <<- res
}
}
}))
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
comment = "#>",
time_it = TRUE
)
```

Expand Down Expand Up @@ -99,3 +112,8 @@ ngm_italy_vacc <- apply_vaccination(

ngm_italy_vacc
```

```{r}
all_times
```

20 changes: 19 additions & 1 deletion vignettes/parallel-computing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ vignette: >
---

```{r, include = FALSE}
all_times <- list() # store the time for each chunk
knitr::knit_hooks$set(time_it = local({
now <- NULL
function(before, options) {
if (before) {
now <<- Sys.time()
} else {
res <- difftime(Sys.time(), now)
all_times[[options$label]] <<- res
}
}
}))
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
comment = "#>",
time_it = TRUE
)
```

Expand Down Expand Up @@ -70,3 +83,8 @@ synthetic_settings_5y_perth <- predict_setting_contacts(
age_breaks = c(seq(0, 85, by = 5), Inf)
)
```

```{r}
all_times
```

21 changes: 20 additions & 1 deletion vignettes/sir-model.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,24 @@ vignette: >
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
all_times <- list() # store the time for each chunk
knitr::knit_hooks$set(time_it = local({
now <- NULL
function(before, options) {
if (before) {
now <<- Sys.time()
} else {
res <- difftime(Sys.time(), now)
all_times[[options$label]] <<- res
}
}
}))
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
comment = "#>",
time_it = TRUE
)

```

```{r setup}
Expand Down Expand Up @@ -564,3 +578,8 @@ conmat_prem_soln %>%


So now we have as fair of a comparison of the two matrices as we will get, and yet, there are significant differences in the dynamics of the two models.

```{r}
all_times
```

16 changes: 15 additions & 1 deletion vignettes/visualising-conmat.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,30 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
```{r}
all_times <- list() # store the time for each chunk
knitr::knit_hooks$set(time_it = local({
now <- NULL
function(before, options) {
if (before) {
now <<- Sys.time()
} else {
res <- difftime(Sys.time(), now)
all_times[[options$label]] <<- res
}
}
}))
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
time_it = TRUE,
fig.width = 8,
fig.height = 8,
dev = "png"
)
```


```{r setup}
library(conmat)
```
Expand Down
Loading