Skip to content

Commit

Permalink
Merge pull request #36 from UCD-SERG/sim.cs
Browse files Browse the repository at this point in the history
Sim.cs
  • Loading branch information
kaiemjoy authored Nov 18, 2023
2 parents 0f38691 + b740925 commit 187140a
Show file tree
Hide file tree
Showing 18 changed files with 140,591 additions and 1,650 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Suggests:
testthat (>= 3.0.0),
readr,
ggplot2,
bookdown
bookdown,
doParallel
VignetteBuilder: knitr
LazyData: true
Encoding: UTF-8
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export(est.incidence.by)
export(fdev)
export(getAdditionalData)
export(postprocess_fit)
export(sim.cs)
importFrom(Rcpp,sourceCpp)
importFrom(dplyr,across)
importFrom(dplyr,all_of)
Expand All @@ -21,6 +22,7 @@ importFrom(dplyr,distinct)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,inner_join)
importFrom(dplyr,is.grouped_df)
importFrom(dplyr,mutate)
importFrom(dplyr,n)
importFrom(dplyr,pull)
Expand All @@ -43,6 +45,7 @@ importFrom(stats,optim)
importFrom(stats,pgamma)
importFrom(stats,plnorm)
importFrom(stats,qnorm)
importFrom(stats,runif)
importFrom(stats,xtabs)
importFrom(tibble,as_tibble)
importFrom(tibble,column_to_rownames)
Expand Down
2 changes: 1 addition & 1 deletion R/df_to_array.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ df_to_array = function(
}

all_factors =
df |> select(dim_var_names) |> sapply(F = is.factor) |> all()
df |> select(dim_var_names) |> sapply(FUN = is.factor) |> all()

if(!all_factors)
{
Expand Down
13 changes: 13 additions & 0 deletions R/prep_curve_params_for_array.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
prep_curve_params_for_array = function(data)
{
data |>
mutate(y1 = .data$y1 - .data$y0) %>%
mutate(r = .data$r - 1) %>%
tidyr::pivot_longer(
names_to = "parameter",
cols = c("y0", "y1", "t1", "alpha", "r") ) |>
mutate(parameter = factor(.data$parameter, levels = unique(.data$parameter))) %>%
select(-any_of(c("Country", "ageCat"))) %>%
mutate(value = log(.data$value)) %>%
droplevels()
}
2 changes: 2 additions & 0 deletions R/serocalculator-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
#' @importFrom dplyr everything
#' @importFrom dplyr filter
#' @importFrom dplyr inner_join
#' @importFrom dplyr is.grouped_df
#' @importFrom dplyr mutate
#' @importFrom dplyr n
#' @importFrom dplyr pull
Expand All @@ -125,6 +126,7 @@
#' @importFrom stats formula
#' @importFrom stats nlm
#' @importFrom stats qnorm
#' @importFrom stats runif
#' @importFrom stats xtabs
#' @importFrom tibble as_tibble
#' @importFrom tibble column_to_rownames
Expand Down
Loading

0 comments on commit 187140a

Please sign in to comment.