|
1 | | -# socialmixr (development version) |
| 1 | +# socialmixr 0.5.0 |
2 | 2 |
|
3 | | -* Added `assign_age_groups()` and `survey_country_population()` (#131, #226) |
| 3 | +This release focuses on improved modularity and flexibility for contact matrix |
| 4 | +workflows. Key highlights include new standalone functions for age group |
| 5 | +assignment and population data retrieval, more intuitive handling of age |
| 6 | +limits, and the beginning of a transition to the |
| 7 | +[contactsurveys](https://github.com/epiforecasts/contactsurveys) package for |
| 8 | +survey downloads. |
4 | 9 |
|
5 | | -* `as_contact_survey()` no longer requires `country` and `year` columns. These columns are now auto-detected if present, but surveys without them can be loaded successfully (#193, #199). |
| 10 | +## Breaking changes |
6 | 11 |
|
7 | | -* Reduced verbosity by removing messages about removing participants/contacts with missing ages (#228). |
| 12 | +* `contact_matrix()` now preserves all user-specified `age_limits`, even when |
| 13 | + no participants exist in some age groups. Previously, age groups beyond the |
| 14 | + maximum participant age were silently dropped. Empty age groups now show |
| 15 | + 0 participants and NA values in the matrix. This may change matrix dimensions |
| 16 | + for existing code (@Bisaloo, #144, #231). |
8 | 17 |
|
9 | | -## Breaking changes |
| 18 | +* `contact_matrix(counts = TRUE)$matrix` now returns an array rather than an |
| 19 | + xtabs object. This matches the existing output format of |
| 20 | + `contact_matrix(counts = FALSE)$matrix` (@Bisaloo, #118). |
| 21 | + |
| 22 | +* When `age_limits` is not specified, it is now inferred from both participant |
| 23 | + and contact ages, not just participant ages. This may result in more age |
| 24 | + groups if contacts include ages beyond the participant age range (#230). |
10 | 25 |
|
11 | | -* When `age.limits` is not specified, it is now inferred from both participant and contact ages, not just participant ages. This may result in more age groups if contacts include ages beyond the participant age range (#230). |
| 26 | +## New features |
12 | 27 |
|
13 | | -* `contact_matrix()` now preserves all user-specified `age.limits`, even when no participants exist in some age groups. Previously, age groups beyond the maximum participant age were silently dropped. Empty age groups now show 0 participants and NA values in the matrix. This may change matrix dimensions for existing code (#144, #231). |
| 28 | +* `as_contact_survey()` no longer requires `country` and `year` columns. These |
| 29 | + columns are now auto-detected if present, but surveys without them can be |
| 30 | + loaded successfully (#193, #199). |
14 | 31 |
|
15 | | -* `contact_matrix(counts = TRUE)$matrix` is now an array rather than an xtabs object. This matches the existing output format of `contact_matrix(counts = FALSE)$matrix` (#118). |
| 32 | +* New `assign_age_groups()` and `survey_country_population()` functions allow |
| 33 | + modular pre-processing of survey data (#131, #226). |
| 34 | + |
| 35 | +* Reduced verbosity by removing messages about removing participants/contacts |
| 36 | + with missing ages (#228). |
16 | 37 |
|
17 | 38 | ## Bug fixes |
18 | 39 |
|
19 | | -* `load_survey()` now correctly loads longitudinal surveys with repeated observations per participant (e.g., sday files with wave/studyDay columns). Previously, these columns were silently dropped (#192, #194). |
| 40 | +* `clean()` now correctly processes age values with units (e.g., "6 months", |
| 41 | + "52 weeks") (@LloydChapman, #250, #256). |
20 | 42 |
|
21 | | -* `contact_matrix()` now warns when a survey contains multiple observations per participant, as results will aggregate across all observations (#260). |
| 43 | +* `contact_matrix()` now warns when a survey contains multiple observations per |
| 44 | + participant, as results will aggregate across all observations (#260). |
22 | 45 |
|
23 | | -* A bug was fixed leading to excess contacts with `NA` age if the lowest age group did not start at 0. |
| 46 | +* `load_survey()` now correctly loads longitudinal surveys with repeated |
| 47 | + observations per participant (e.g., sday files with wave/studyDay columns). |
| 48 | + Previously, these columns were silently dropped (@njtierney, #192, #194). |
24 | 49 |
|
25 | | -* Fixed bugs in `clean()` that caused errors or incorrect results when processing age values with units (e.g., "6 months", "52 weeks") (#256). |
| 50 | +* Fixed a bug leading to excess contacts with `NA` age if the lowest age group |
| 51 | + did not start at 0 (@lwillem, #170). |
26 | 52 |
|
27 | 53 | ## Deprecations |
28 | 54 |
|
29 | | -* The `missing_contact_age = "sample"` option in `contact_matrix()` and `assign_age_groups()` has been soft-deprecated and will be removed in a future version. Use `"remove"` to exclude contacts with missing ages, `"keep"` to retain them as a separate age group, or `"ignore"` to drop only those contacts (#273). |
| 55 | +* Argument names with dots (e.g., `age.limits`) have been deprecated in favour |
| 56 | + of underscores (e.g., `age_limits`) in `contact_matrix()`, |
| 57 | + `as_contact_survey()`, `pop_age()`, and `clean()`. The old argument names |
| 58 | + still work but will produce deprecation warnings (#160). |
30 | 59 |
|
31 | | -* Argument names with dots (e.g., `age.limits`) have been deprecated in favour of underscores (e.g., `age_limits`) in `contact_matrix()`, `as_contact_survey()`, `pop_age()`, and `clean()`. The old argument names still work but will produce deprecation warnings (#160). |
| 60 | +* `get_survey()`, `download_survey()`, `get_citation()`, `list_surveys()`, and |
| 61 | + `survey_countries()` have been soft-deprecated and moved to |
| 62 | + [contactsurveys](https://github.com/epiforecasts/contactsurveys). This is |
| 63 | + part of decoupling these features from socialmixr to reduce dependencies |
| 64 | + (@njtierney, #179, #207). These will continue to work until version 1.0.0. |
32 | 65 |
|
33 | | -* We have soft-deprecated `get_survey()`, `download_survey()`, `get_citation()` and `list_surveys()` and moved these to [contactsurveys](https://github.com/epiforecasts/contactsurveys). We have also soft-deprecated `survey_countries()` as this called `get_survey()` internally. This is part of decoupling these features from socialmixr to reduce dependencies (#207 and #179). These will continue to be supported until we move to a major release (version 1.0.0) of socialmixr. In the meantime, we recommend that users use the [contactsurveys](https://github.com/epiforecasts/contactsurveys) package, as these functions have improved caching and support there. |
| 66 | +* The `missing_contact_age = "sample"` option in `contact_matrix()` and |
| 67 | + `assign_age_groups()` has been soft-deprecated. Use `"remove"` to exclude |
| 68 | + contacts with missing ages, `"keep"` to retain them as a separate age group, |
| 69 | + or `"ignore"` to drop only those contacts (#273). |
34 | 70 |
|
35 | 71 | # socialmixr 0.4.0 |
36 | 72 |
|
|
48 | 84 | ```r |
49 | 85 | # No longer works! |
50 | 86 | contact_matrix("10.5281/zenodo.1095664") |
51 | | - |
| 87 | + |
52 | 88 | # Recommended workflow |
53 | 89 | get_survey("10.5281/zenodo.1095664") |> |
54 | 90 | contact_matrix() |
|
70 | 106 | ## Internal changes |
71 | 107 |
|
72 | 108 | * Code quality is now ensured through continuous integration and the lintr package (#69). |
73 | | -* [Cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) of `download_survey()` has been reduced by externalising the `find_common_prefix()` function and failing early instead of relying on unnecessary if/else sequences |
| 109 | +* [Cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) of `download_survey()` has been reduced by externalising the `find_common_prefix()` function and failing early instead of relying on unnecessary if/else sequences |
74 | 110 | * More generous filename checks now pass files named e.g. "..._participants_common..." an not only "...participant_common..." |
75 | 111 | * The package now sets a custom user agent when downloading survey data (#82). |
76 | 112 | * A problem was fixed where attempted joins of files could lead to blowing up memory use (#75). |
@@ -135,7 +171,7 @@ to wpp2017 package |
135 | 171 | * more consistency checks and tests |
136 | 172 | * performance improvements when weighting |
137 | 173 | * 'pop_age' can now be called by the user |
138 | | - |
| 174 | + |
139 | 175 | # socialmixr 0.1.2 |
140 | 176 |
|
141 | 177 | * improved downloading form Zenodo; only a single download is used now |
|
0 commit comments