Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
njtierney authored Aug 19, 2024
2 parents 29e00f8 + ecf3fe8 commit f8cb4f5
Show file tree
Hide file tree
Showing 18 changed files with 2,889 additions and 12 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
^pkgdown$
^touchstone$
^cran-comments\.md$
^paper$
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ README_cache
.vscode/launch.json
.pre-commit-config.yaml
tests/README.md
paper/*.html
paper/*.pdf
paper/paper_cache/
paper/paper_files/
chitra/
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ Description: Builds contact matrices using GAMs and population data. This packag
Electoral Commission and Australian Bureau of Statistics) 2020.
License: MIT + file LICENSE
Depends:
R (>= 2.10)
R (>= 4.1.0)
Suggests:
covr,
knitr,
vdiffr,
testthat (>= 3.0.0),
rmarkdown,
stringr,
future,
spelling,
deSolve
Expand All @@ -54,7 +53,7 @@ Language: en-US
LazyData: true
LazyDataCompression: xz
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Imports:
mgcv,
dplyr (>= 1.0.9),
Expand All @@ -75,6 +74,7 @@ Imports:
vctrs,
scales,
english,
waldo
waldo,
stringr
URL: https://github.com/idem-lab/conmat
BugReports: https://github.com/idem-lab/conmat/issues
17 changes: 17 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export(abs_age_state)
export(abs_age_work_lga)
export(abs_age_work_state)
export(abs_unabbreviate_states)
export(add_age_partial_sum)
export(add_intergenerational)
export(add_modelling_features)
export(add_offset)
Expand All @@ -68,8 +69,11 @@ export(apply_vaccination)
export(as_conmat_population)
export(as_setting_prediction_matrix)
export(autoplot)
export(clean_term_names)
export(conmat_population)
export(create_age_grid)
export(estimate_setting_contacts)
export(extract_term_names)
export(extrapolate_polymod)
export(fit_setting_contacts)
export(fit_single_contact_model)
Expand All @@ -86,16 +90,21 @@ export(get_polymod_per_capita_household_size)
export(get_polymod_population)
export(get_polymod_setting_data)
export(get_setting_transmission_matrices)
export(gg_age_partial_pred_long)
export(gg_age_partial_sum)
export(gg_age_terms_settings)
export(matrix_to_predictions)
export(new_age_matrix)
export(new_ngm_setting_matrix)
export(new_setting_data)
export(per_capita_household_size)
export(pivot_longer_age_preds)
export(polymod)
export(population)
export(population_label)
export(predict_contacts)
export(predict_contacts_1y)
export(predict_individual_terms)
export(predict_setting_contacts)
export(predictions_to_matrix)
export(prepare_population_for_modelling)
Expand All @@ -104,6 +113,14 @@ export(scaling)
export(setting_prediction_matrix)
export(transmission_probability_matrix)
import(rlang)
importFrom(ggplot2,aes)
importFrom(ggplot2,autoplot)
importFrom(ggplot2,coord_fixed)
importFrom(ggplot2,facet_grid)
importFrom(ggplot2,facet_wrap)
importFrom(ggplot2,geom_tile)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,scale_fill_viridis_c)
importFrom(ggplot2,theme_minimal)
importFrom(magrittr,"%>%")
importFrom(stats,predict)
13 changes: 8 additions & 5 deletions R/checkers.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,16 @@ check_if_var_numeric <- function(data, var, attribute) {
}
}

check_if_data_frame <- function(x) {
check_if_data_frame <- function(x,
arg = rlang::caller_arg(x),
call = rlang::caller_env()) {
if (!is.data.frame(x)) {
cli::cli_abort(
c(
"x must be a {.cls data.frame}",
"i" = "x is {.cls {class(x)}}"
)
message = c(
"{.arg {arg}} must be a {.cls data.frame}",
"i" = "{.arg {arg}} is {.cls {class(x)}}"
),
call = call
)
}
}
Expand Down
Loading

0 comments on commit f8cb4f5

Please sign in to comment.