Skip to content

Commit

Permalink
reduce R min version to 3.6.0 and use magrittr pipe (%>%) in vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Oct 22, 2024
1 parent 058acc2 commit efdc99f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: '3.6'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ URL: https://github.com/epiverse-trace/epiparameter/,
https://epiverse-trace.github.io/epiparameter/
BugReports: https://github.com/epiverse-trace/epiparameter/issues
Depends:
R (>= 4.1.0)
R (>= 3.6.0)
Imports:
checkmate,
cli,
Expand All @@ -43,6 +43,7 @@ Suggests:
ggplot2,
jsonlite,
knitr,
magrittr,
RColorBrewer,
rmarkdown,
spelling,
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ The are a large number of ***breaking changes*** in this release, primarily func
* The `<vb_epidist>` class and it's methods have been removed from the package. It was not being used and was increasing the complexity and maintenance load of the package (PR #359).
* `create_prob_dist()` has been renamed to `create_prob_distribution()` (PR #381).
* `validate_epiparameter()` (previously `validate_epidist()`) has been renamed `assert_epiparameter()`, and `test_epiparameter()` has been added, with the aim to harmonise design with [{contactmatrix}](https://github.com/socialcontactdata/contactmatrix) (PR #366).
* The minimum version of R required by the package is now 4.1.0 due to the use of the base R pipe (`|>`) in dependencies (PR #384).

## Minor changes

* The minimum version of R required by the package (3.6.0) is now explicitly tested on the R-CMD-check GitHub actions workflow (PR #404).

## Bug fixes

Expand Down
20 changes: 9 additions & 11 deletions vignettes/design_principles.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,18 @@ if (!all(epiparameter_class_methods %in% groups$functions)) {
}
library(visNetwork)
visNetwork(nodes, edges) |>
visNodes(font = list(size = 18)) |>
visGroups(groupname = "<epiparameter>", color = colours[1]) |>
visGroups(groupname = "Getters", color = colours[2]) |>
visGroups(groupname = "Modifiers", color = colours[3]) |>
visNetwork(nodes, edges) %>%
visNodes(font = list(size = 18)) %>%
visGroups(groupname = "<epiparameter>", color = colours[1]) %>%
visGroups(groupname = "Getters", color = colours[2]) %>%
visGroups(groupname = "Modifiers", color = colours[3]) %>%
visGroups(
groupname = "Distribution functions",
color = colours[4]
) |>
visGroups(groupname = "Utilities", color = colours[5]) |>
visGroups(groupname = "Checkers", color = colours[6]) |>
visGroups(groupname = "Conversions", color = colours[7]) |>
) %>%
visGroups(groupname = "Utilities", color = colours[5]) %>%
visGroups(groupname = "Checkers", color = colours[6]) %>%
visGroups(groupname = "Conversions", color = colours[7]) %>%
visGroups(groupname = "Coercion", color = colours[8])
```

Expand Down Expand Up @@ -166,8 +166,6 @@ The aim is to restrict the number of dependencies to a minimal required set for

[{jsonlite}](https://CRAN.R-project.org/package=jsonlite) is a suggested dependency because it is used to read the parameter library which is stored as a JSON file. However, it is only read by an internal function and instead the data is available to the user via `sysdata.rda`, so {jsonlite} is not required as an imported dependency.

Currently {epiparameter} deviates from the [Epiverse policy on the number of previous R versions it supports](https://epiverse-trace.github.io/blueprints/dependencies.html#base-r-support-schedule). The {epiparameter} package requires R version >= 4.1.0 which only includes the current version and the last three minor R versions rather than the policy of four minor versions, as of September 2024. The reasons for this change is to enable usage of the base R pipe (`|>`).

## Contribute

In addition to the [package contributing guide](https://github.com/epiverse-trace/.github/blob/main/CONTRIBUTING.md), please refer to the [{epiparameter} specific contributing guidelines for adding epidemiological parameter to the package library](https://epiverse-trace.github.io/epiparameter/articles/data_protocol.html#contributing-to-the-package).

0 comments on commit efdc99f

Please sign in to comment.