Skip to content

Commit d3d4887

Browse files
committed
run tests/vignette single-threadedly
1 parent 503b106 commit d3d4887

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

tests/testthat.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ library(testthat)
33
library(socialmixr)
44
# nolint end
55

6+
data.table::setDTthreads(1)
67
test_check("socialmixr")

tests/testthat/test-plot.r

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,21 @@ suppressWarnings({
55
})
66

77
test_that("contact matrix can be plotted", {
8-
skip_on_cran()
98
expect_no_error(matrix_plot(dta$matrix))
109
})
1110

1211
test_that("contact matrix per capita can be plotted", {
13-
skip_on_cran()
1412
expect_no_error(matrix_plot(dta$matrix.per.capita))
1513
})
1614

1715
test_that("contact matrix can be plotted with different color palette", {
18-
skip_on_cran()
1916
expect_no_error(matrix_plot(dta$matrix, color.palette = rainbow))
2017
})
2118

2219
test_that("contact matrix can be plotted with ad-hoc min and max values for the legend", {
23-
skip_on_cran()
2420
expect_no_error(matrix_plot(dta$matrix, min.legend = 4, max.legend = 40))
2521
})
2622

2723
test_that("contact matrix can be plotted with (ad-hoc) min and max values for the legend", {
28-
skip_on_cran()
2924
expect_no_error(matrix_plot(dta$matrix, min.legend = 4, max.legend = 40))
3025
})

vignettes/socialmixr.Rmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ knitr::opts_chunk$set(
2020
collapse = TRUE,
2121
comment = "#>"
2222
)
23+
data.table::setDTthreads(1)
2324
```
2425

2526
[socialmixr](https://github.com/epiforecasts/socialmixr) is an `R` package to derive social mixing matrices from survey data. These are particularly useful for age-structured [infectious disease models](https://en.wikipedia.org/wiki/Mathematical_modelling_of_infectious_disease). For background on age-specific mixing matrices and what data inform them, see, for example, the paper on POLYMOD by [@mossong_social_2008].
@@ -489,7 +490,7 @@ ggplot(df, aes(x = age.group, y = age.group.contact, fill = contacts)) +
489490

490491
The contact matrices can also be plotted with the `matrix_plot()` function as a grid of colored rectangles with the numeric values in the cells. Heat colors are used by default, though this can be changed.
491492

492-
```{r fig.width=4, fig.height=4, eval = FALSE}
493+
```{r fig.width=4, fig.height=4}
493494
matrix_plot(mr)
494495
matrix_plot(mr, color.palette = gray.colors)
495496
```

0 commit comments

Comments
 (0)