Skip to content

Commit

Permalink
Add data simulation functions (#126)
Browse files Browse the repository at this point in the history
* remove serodata .Rdata and .Rd files

* remove R/serodata.R

* doc: update functions  documentation replacing  for  in examples

* doc: update README and vignettes
This commit changes the removed preloaded dataset `serodata` for the identical `chagas2012`.

* fix: minor correction to test_modelling

* feat: add function `get_foi_central_estimates()` to the modelling module.
This change is meant to simplify `fit_seromodel()`. This commit also changes the name of the stanfit object in the output of `fit_seromodel()` from `fit` to `seromodel_fit`.

* fix: minor corrections to tests according to commit 052c90c

* fix: change  to  in model_comparison

* doc: add documentation file for

* doc: minor correction to  documentation

* refac: updates

* refac: reduce the output of

* fix(tests): change storing format of  model object files from .json to .RDS and updates test_visualization accordingly

* Remove `serodata` from pre-loaded datasets of the package (#107)

* remove serodata .Rdata and .Rd files

* remove R/serodata.R

* doc: update functions  documentation replacing  for  in examples

* doc: update serofoi logo

* doc: update README and vignettes
This commit changes the removed preloaded dataset `serodata` for the identical `chagas2012`.

* fix: minor correction to test_modelling

* Fixes #115 (#116)

* 82 tidyverse dependency (#120)

* Enabling CMD check when doing pull request on `dev`

* Removed tidyverse dependency

* refac: `fit_seromodel` returns stanfit object (#117)

* refac: `fit_seromodel` returns a stanfit object
`fit_seromodel` returns a stanfit object now, which induces changes all across the pachage
- `seromodel_object$seromodel_fit -> seromodel_object`:
    * `get_foi_central_estimates`
    * `extract_seromodel_summary`
    * `plot_seroprev_fitted`
    * `plot_foi`
    * `plot_rhats`
    * `plot_seromodel`
    * `get_table_rhats`
- add `serodata` as input:
    * `get_foi_central_estimates`
    * `extract_seromodel_summary`
    * `plot_seroprev_fitted`
    * `plot_seromodel`
    * `plot_rhats`
    * `plot_foi`
    * `get_table_rhats`
- use of `exposure_years` (this suggest adding a function for this purpose):
    * `get_foi_central_estimates`
    * `get_table_rhats`
- minor corrections:
    * `plot_seromodel` -> correction to exception

* tests(refac): re-generate .RDS files used in tests

* tests(refac): update tests according to 7be19f9
- change `model_object$seromodel_fit` to `model_object`
- add `serodata` as input where needed
- minor syntax changes to test_issue_47.R

* fix examples
Fix examples of functions across the package in accordance to the
new output of `fit_seromodel`.

Updated examples:
- `get_table_rhats`
- `get_foi_central_estimates`
- `get_prev_expanded`
- `extract_seromodel_summary`
- `plot_seroprev_fitted`
- `plot_foi`
- `plot_rhats`
- `plot_seromodel`
- `plot_info_table`

* refac: replace `get_exposure_ages` for `get_cohort_ages`

add `get_cohort_ages`: this function serves as replacement for
`get_exposure_ages` and also includes the information of
`exposure_years`, which was being used in some functions.

Affected functions:
- `fit_seromodel`
- `get_exposure_matrix`
- `get_table_rhats`

* test: add test for `get_cohort_ages` to the test_modelling.R

* refac: replace `serodata` for `cohort_ages` where needed

Affected functions:
- `get_table_rhats`
- `get_foi_central_estimates`
- `extract_seromodel_summary`
- `plot_foi`
- `plot_rhats`
- `plot_seromodel`

* doc: update documentation
use @inheritParams to simplify documentation

* add comment to exception in `fit_seromodel`

* refac: specify argument `parameter_name`
Explicitely specify argument `parameter_name = "logLikelihood"`
in `loo::loo`

* change condition to check whether sampling is done or not

* doc: update vignettes according to changes

* doc: update documentation and examples

* doc: parameter description correction

parameter `seromodel_object` description correction in
`get_foi_central_estimates`

* doc: minor corrections to functions documentation

* fix: add input check for `age_mean_f` column (#123)

add input check for `age_mean_f` in `serodata` in the following functions
- `prepare_serodata`
- `prepare_bin_data`

* Add input validation (#92)

* Added argument matching in fit_seromodel()

* Added allowed options to arg foi_model

* Added input validation to prepare_serodata()

* Fixed the check for required columns

* Regenerated the docs

---------

Co-authored-by: ntorresd <[email protected]>

* Remove test_visualisation and related files

* Convert logo to png
To keep a reasonable repo size

* Add functions to simulate datasets to the seroprevalence_data module. (#58)

* fix: add exception to function plot_foi() to plot a FOI trend with different length along with the data for the case when their sizes don't coincide

* clean test_visualisation

* feature: add three functions to simulate datasets. get_sim_counts() generates a list with simulated counts by age following a binomial distribution. generate_sim_data() uses the counts generated by get_sim_counts() to create a dataframe with the necessary structure to use other functions of the package. group_sim_data() serves to group the previously generated dataset by age group; right now it groups the data by periods of 5 years.

* add test_simulate_data to test the data simulation functions in the seroprevalence_data module

* doc: update generate_sim_data description

* doc: complete get_sim_counts documentation and remove corresponding TODO item in seroprevalence_data.R

* feat: add function get_sim_prob to seroprevalence_data.R. This function generates a list containing a seropositivity destribution by age following the specified force of infection.

* doc: complete documentation of generate_sim_data in seroprevalence_data.R. Remove corresponding TODO item.

* feat: add function `get_age_group` to seroprevalence_data.R.
This function was taken from vaccineff [vaccineff](https://github.com/epiverse-trace/vaccineff).
Minor changes to `group_sim_data` description.

* feat (refac): use `get_age_group` function to generate the age groups in `group_sim_data`

* doc: add or update documentation for data simulation functions

* refac: minor changes to `get_sim_prob()`
Move seed setting from `get_sim_prob()` to `get_sim_counts()`. Remove unnecessary parameters from documentation in `get_sim_prob()`

* doc: update documentation for data simulation functions
update `foi` parameter description
- `get_sim_prob()`
- `get_sim_counts`
- `generate_sim_data`
update `birth_year` parameter description
- `prepare_serodata()`
- `prepare_bin_data()`
- `get_sim_counts()`
- `get_sim_prob()`
update function descriptions
- `get_sim_counts()`
- `generate_sim_data()`
update return description
- `get_sim_counts()`
remove export
- `prepare_bin_data()`
- `get_sim_prob()`
remove unnecessary input parameters
- `get_sim_prob()`
- `get_sim_counts()`

* refac: change `size_age_class` for `sample_size_by_age`

* doc: update documentation of data simulation functions
update @return description for `get_age_group()`
update documentation files for
- `generate_sim_data()`
- `get_age_group()`
- `get_sim_counts()`
- `group_sim_data()`

* doc: remove example for `get_age_group()`

* refac: change name and output of `get_sim_prob`
change name of `get_sim_prob` to `get_sim_n_seropositive`.
The function now returns a dataframe containing the exposure ages and the number of seropositive cases for each age.

* doc: add example for `get_sim_counts()`

* Revert "refac: change name and output of `get_sim_prob`"

This reverts commit 966e463.

* refac: change name and output of `get_sim_prob()`
change name of `get_sim_prob()` to `get_sim_probability`.
The output of the function is now a dataframe.

* refac: change name and output of `get_sim_counts`
change name of function `get_sim_counts` to `get_sim_n_seropositive` and update the documentation accordingly.
minor correction to documentation of `get_sim_probability`

* doc: minor correction to function documentation
minor correction to function `get_age_group` documentation

* doc: remove function `group_sim_data` from export
remove function `group_sim_data` from export and the corresponding
example

* refac: simplify function `get_age_group`
Remove unnecessary parameters from `get_age_group`.
Now the function takes an age vector as input rather than a dataframe
containing an specific age column.

* test: remove data writing from test
Remove data writing from `test_simulate_data.R` as well as the corresponding
.csv files.

* clean: remove unused data paths from test
Remove unused data paths from `test_simulate_data`

* test: add tests for `get_sim_` functionalities
Add tests for `get_sim_probability` and `get_sim_n_seropositive`

* test(refac): modify test for data sim functions
Modify test for `generate_sim_data` and `group_sim_data` functions.
Remove unnecessary model running.
Remove `expect_doppleganger` tests.

* add test for values from `get_sim_probability`

Add `get_sim_probability` to export to enable testing.
Test the values of the probabilities.

* test: add statistical test for `generate_sim_data`

The idea of the test is to make sure that the foi trend used to simulate
the data is in the confidence interval of a suitable model.

Add possibility to test for:
- constant FoI
- smooth-descendent FoI

Minor clean up of `plot_foi`.

* add pracma to dependencies

* add parameter descriptions in `generate_sim_data`

* doc: update documentation

* test: add analytical test for constant foi

Add analytical test for constant foi for large sample sizes.

* test: add test for data simulation with time-varying foi

* small syntax corrections in test_sim_data.R

---------

Co-authored-by: ntorresd <[email protected]>
Co-authored-by: Nicolás Torres Domínguez <[email protected]>
Co-authored-by: Jaime Pavlich-Mariscal <[email protected]>
Co-authored-by: James Azam <[email protected]>
  • Loading branch information
5 people authored Nov 8, 2023
1 parent fe428e5 commit 6db956b
Show file tree
Hide file tree
Showing 16 changed files with 509 additions and 34 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Imports:
jsonlite,
loo,
purrr,
pracma,
qtl,
reshape2,
usethis,
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

export(extract_seromodel_summary)
export(fit_seromodel)
export(generate_sim_data)
export(get_cohort_ages)
export(get_exposure_matrix)
export(get_foi_central_estimates)
export(get_prev_expanded)
export(get_sim_n_seropositive)
export(get_sim_probability)
export(get_table_rhats)
export(plot_foi)
export(plot_info_table)
Expand Down
207 changes: 199 additions & 8 deletions R/seroprevalence_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#' \tabular{ll}{
#' \code{age_mean_f} \tab Floor value of the average between age_min and age_max \cr \tab \cr
#' \code{sample_size} \tab The size of the sample \cr \tab \cr
#' \code{birth_year} \tab The year in which the individuals of each age group were bornt \cr \tab \cr
#' \code{birth_year} \tab Years in which the subjects were borned
#' according to the age group marker \code{age_mean_f}\cr \tab \cr
#' according to the age group marker \code{age_mean_f}\cr \tab \cr
#' \code{prev_obs} \tab Observed prevalence \cr \tab \cr
#' \code{prev_obs_lower} \tab Lower limit of the confidence interval for the observed prevalence \cr \tab \cr
#' \code{prev_obs_upper} \tab Upper limit of the confidence interval for the observed prevalence \cr \tab \cr
Expand All @@ -37,21 +39,24 @@ prepare_serodata <- function(serodata = serodata,
#Check that serodata has the right columns
stopifnot("serodata must contain the right columns" =
all(c("survey", "total", "counts", "age_min", "age_max", "tsur",
"country","test","antibody"
"country", "test", "antibody"
) %in%
colnames(serodata)
) |
all(c("survey", "total", "counts", "age_mean_f", "tsur",
"country", "test", "antibody") %in%
colnames(serodata)
)
)
)
if(!any(colnames(serodata) == "age_mean_f")){
serodata <- serodata %>%
dplyr::mutate(age_mean_f = floor((age_min + age_max) / 2), sample_size = sum(total))
}
}

if(!any(colnames(serodata) == "birth_year")){
serodata <- serodata %>%
dplyr::mutate(birth_year = .data$tsur - .data$age_mean_f)
}

serodata <- serodata %>%
cbind(
Hmisc::binconf(
Expand All @@ -76,8 +81,8 @@ prepare_serodata <- function(serodata = serodata,
#' Function that prepares a pre-processed serological survey dataset to plot the binomial confidence intervals of the seroprevalence grouped by
#' age group
#'
#' This function prepapares a given pre-processed serological dataset (see \code{\link{prepare_serodata}}) to plot the binomial confidence intervals
#' of its corresponding seroprevalence grouped by age group.
#' This function prepapares a given pre-processed serological dataset (see \code{\link{prepare_serodata}}) to plot the binomial confidence intervals
#' of its corresponding seroprevalence grouped by age group.
#' @inheritParams run_seromodel
#' @return data set with the binomial confidence intervals
#' @examples
Expand Down Expand Up @@ -115,4 +120,190 @@ prepare_bin_data <- function(serodata) {
p_obs_bin_u = .data$Upper
)
return(xx)
}
}

#' Function that generates the probabilities of being previously exposed to a pathogen.
#'
#' @param sim_data A dataframe object containing the following columns:
#' \tabular{ll}{
#' \code{tsur} \tab Year of the survey\cr \tab \cr
#' \code{age_mean_f} \tab Age \cr \tab \cr
#' \code{birth_year} \tab Years in which the subjects were borned
#' according to the age group marker \code{age_mean_f}\cr \tab \cr
#' }
#' @param foi Numeric atomic vector corresponding to the desired Force-of-Infection ordered from past to present
#' @param seed The seed for random number generation.
#' @return A dataframe containing the following columns:
#' \tabular{ll}{
#' \code{age} \tab Exposure ages \cr \tab \cr
#' \code{probability} \tab Probability to obtain a seropositive case for each age according to the provided FoI\cr \tab \cr
#' }
#' @export
get_sim_probability <- function(sim_data, foi) {
cohort_ages <- get_cohort_ages(sim_data)
exposure_ages <- rev(cohort_ages$age)
exposure_matrix <- get_exposure_matrix(sim_data)
probabilities <- purrr::map_dbl(exposure_ages, ~1-exp(-pracma::dot(exposure_matrix[., ], foi)))

sim_probability <- data.frame(
age = exposure_ages,
probability = probabilities
)
return(sim_probability)
}

#' Function that generates a sample of counts of seropositive individuals by sampling from a binomial distribution
#'
#' @param sim_data A dataframe object containing the following columns:
#' \tabular{ll}{
#' \code{tsur} \tab Year of the survey\cr \tab \cr
#' \code{age_mean_f} \tab Age \cr \tab \cr
#' \code{birth_year} \tab Years in which the subjects were borned
#' according to the age group marker \code{age_mean_f}\cr \tab \cr
#' }
#' @param foi Numeric atomic vector corresponding to the desired Force-of-Infection ordered from past to present
#' @param sample_size_by_age Sample size for each age group: either a single integer indicating that the sample size is
#' the same for all ages or a vector of sample sizes the same length as
#' This corresponds to the number of trials \code{size} in \link[stats]{rbinom}.
#' @param seed The seed for random number generation.
#' @return A dataframe containing the following columns:
#' \tabular{ll}{
#' \code{age} \tab Age by the time of the survey \cr \tab \cr
#' \code{n_seropositive} \tab Number of positive cases sampled according to the provided FoI \cr \tab \cr
#' }
#' simulated list of counts following a binomial distribution in accordance with a given
#' force of infection and age class sizes.
#' @examples
#'\dontrun{
#' foi <- rep(0.02, 50)
#' sim_data <- generate_sim_data(foi = foi,
#' sample_size_by_age = 5,
#' tsur = 2050,
#' birth_year_min = 2000,
#' survey_label = 'foi_sim')
#' sim_n_seropositive <- get_sim_n_seropositive(sim_data = sim_data,
#' foi = foi)
#' }
#' @export
get_sim_n_seropositive <- function(sim_data, foi, sample_size_by_age, seed = 1234) {
sim_probability <- get_sim_probability(sim_data = sim_data, foi = foi)

set.seed(seed = seed)
n_seropositive <- purrr::map_int(sim_probability$probability, ~rbinom(1, sample_size_by_age, .))

sim_n_seropositive <- data.frame(
age = sim_probability$age,
n_seropositive = n_seropositive
)
return(sim_n_seropositive)
}

#' Function that generates a simulated serosurvey according to the specified FoI
#'
#' @param foi Numeric atomic vector corresponding to the desired Force-of-Infection ordered from past to present
#' @param sample_size_by_age Size of each age group specified by either an atomic
#' vector of the same size as \code{foi} or an integer.
#' This corresponds to the number of trials \code{size} in \link[stats]{rbinom}.
#' @param tsur Year in which the serosurvey was conducted.
#' @param birth_year_min Minimum age of year in the simulated serosurvey.
#' @param survey_label Label for the resulting simulated serosurvey.
#' @return Dataframe object containing the simulated data generated from \code{foi}
#' @examples
#'\dontrun{
#' sample_size_by_age = 5
#' foi <- rep(0.02, 50)
#' sim_data <- generate_sim_data(foi = foi,
#' sample_size_by_age = sample_size_by_age,
#' tsur = 2050,
#' birth_year_min = 2000,
#' survey_label = 'sim_constant_foi')
#' }
#' @export
generate_sim_data <- function(foi,
sample_size_by_age,
tsur,
birth_year_min,
survey_label,
test = "fake",
antibody = "IgG",
seed = 1234
){
sim_data <- data.frame(birth_year = c(birth_year_min:(tsur - 1))) %>%
mutate(tsur = tsur,
country = 'None',
test = test,
antibody = antibody,
survey = survey_label,
age_mean_f = tsur - birth_year)
sim_n_seropositive <- get_sim_n_seropositive(sim_data, foi, sample_size_by_age, seed = seed)
sim_data <- sim_data %>%
mutate(counts = sim_n_seropositive$n_seropositive,
total = sample_size_by_age) %>%
prepare_serodata()

return(sim_data)
}

#' Method for constructing age-group variable from age column
#'
#' This function was taken from \link[vaccineff]{get_age_group}.
#' This method splits an age interval from age_min to age_max into
#' (age_max-age_min)/step intervals.
#' By default age_min is set 0, however it can be assigned by
#' convenience.
#' If the method finds ages greater or equal than age_max
#' it assigns the string ">{age_max}".
#' To avoid errors it is necessary to set step < age_max.
#' It is also suggested to choose the step such
#' that age_max%%(step+1) = 0.
#' @param age vector containing age information
#' @param step step used to split the age interval
#' @return age_group factor variable grouping \code{age} by the age intervals
#' specified by \code{min(age)}, \code{max(age)}.
get_age_group <- function(age, step) {
age_min <- min(age)
age_max <- max(age)
n_steps <- as.integer((age_max - age_min) / step) + 1
limits_low <- c(as.integer(seq(age_min,
age_max,
length.out = n_steps)))
limits_hgh <- limits_low + step
lim_labels <- paste(as.character(limits_low), as.character(limits_hgh),
sep = "-")
lim_labels[length(lim_labels)] <- paste0("+",
limits_low[length(limits_low)])
lim_breaks <- c(-Inf, limits_low[2:length(limits_low)] - 1, Inf)

age_group <- cut(age,
breaks = lim_breaks,
labels = lim_labels,
# this is for the intervals to be closed to the left and open to the right
right = FALSE)
return(age_group)
}

#' Function that groups a simulated serological dataset by age
#'
#' @param sim_data Dataframe with the same structure as the output of \code{\link{generate_sim_data}}.
#' @param col_age name of the column containing the age information
#' @param step step used to split the age interval
#' @return Dataframe object containing grouped simulated data generated from \code{foi}
group_sim_data <- function(sim_data,
col_age = "age_mean_f",
step = 5) {
age <- sim_data[[col_age]]
sim_data$age_group <- get_age_group(age = age, step = step)
sim_data_grouped <- sim_data %>%
group_by(age_group) %>%
dplyr::summarise(total = sum(total), counts = sum(counts)) %>%
mutate(tsur = sim_data$tsur[1],
country = "None",
survey = sim_data$survey[1],
test = sim_data$test[1],
antibody = sim_data$antibody[1]) %>%
mutate(age_min = as.integer(sub("\\-.*", "", age_group)),
age_max = as.integer(sub(".*\\-", "", age_group))) %>%
prepare_serodata()

return(sim_data_grouped)
}
46 changes: 26 additions & 20 deletions R/visualisation.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ plot_seroprev <- function(serodata,
#' Function that generates a seropositivity plot corresponding to the specified fitted serological model
#'
#' This function generates a seropositivity plot of the specified serological model object. This includes the original data grouped by age
#' as well as the obtained fitting from the model implementation. Age is located on the x axis and seropositivity on the y axis with its
#' as well as the obtained fitting from the model implementation. Age is located on the x axis and seropositivity on the y axis with its
#' corresponding confidence interval.
#' @inheritParams get_foi_central_estimates
#' @inheritParams run_seromodel
Expand Down Expand Up @@ -108,7 +108,7 @@ plot_seroprev_fitted <- function(seromodel_object,
#' Function that generates a Force-of-Infection plot corresponding to the specified fitted serological model
#'
#' This function generates a Force-of-Infection plot from the results obtained by fitting a serological model.
#' This includes the corresponding binomial confidence interval.
#' This includes the corresponding binomial confidence interval.
#' The x axis corresponds to the decades covered by the survey the y axis to the Force-of-Infection.
#' @inheritParams get_foi_central_estimates
#' @param size_text Text size use in the theme of the graph returned by the function.
Expand Down Expand Up @@ -138,7 +138,6 @@ plot_foi <- function(seromodel_object,
foi <- rstan::extract(seromodel_object,
"foi",
inc_warmup = FALSE)[[1]]

#-------- This bit is to get the actual length of the foi data
foi_data <- get_foi_central_estimates(seromodel_object = seromodel_object,
cohort_ages = cohort_ages)
Expand Down Expand Up @@ -168,16 +167,23 @@ plot_foi <- function(seromodel_object,
ggplot2::xlab("Year")
#TODO Add warning for foi_sim of different length than exposure years
if (!is.null(foi_sim)){
foi_data_length <- nrow(foi_data)
foi_sim_length <- length(foi_sim)
remove_x_values <- foi_sim_length - foi_data_length

foi_sim_data <- data.frame(year = foi_data$year,
foi_sim = foi_sim[-c(1:remove_x_values)])
foi_plot <- foi_plot +
ggplot2::geom_line(data = foi_sim_data, ggplot2::aes(x = year, y = foi_sim),
colour = "#b30909",
size = size_text/8)
if (nrow(foi_data) != length(foi_sim)) {
remove_x_values <- length(foi_sim) - nrow(foi_data)
foi_sim_data <- data.frame(year = foi_data$year,
foi_sim = foi_sim[-c(1:remove_x_values)])
foi_plot <- foi_plot +
ggplot2::geom_line(data = foi_sim_data, ggplot2::aes(x = year, y = foi_sim),
colour = "#b30909",
size = size_text / 8)
}
else{
foi_sim_data <- data.frame(year = foi_data$year,
foi_sim = foi_sim)
foi_plot <- foi_plot +
ggplot2::geom_line(data = foi_sim_data, ggplot2::aes(x = year, y = foi_sim),
colour = "#b30909",
size = size_text / 8)
}
}
}
} else {
Expand Down Expand Up @@ -208,8 +214,8 @@ plot_foi <- function(seromodel_object,

#' Function that generates a plot of the R-hat estimates of the specified fitted serological model
#'
#' This function generates a plot of the R-hat estimates obtained for a specified fitted serological model \code{seromodel_object}.
#' The x axis corresponds to the decades covered by the survey and the y axis to the value of the rhats.
#' This function generates a plot of the R-hat estimates obtained for a specified fitted serological model \code{seromodel_object}.
#' The x axis corresponds to the decades covered by the survey and the y axis to the value of the rhats.
#' All rhats must be smaller than 1 to ensure convergence (for further details check \link[bayesplot]{rhat}).
#' @inheritParams get_foi_central_estimates
#' @param size_text Text size use in the theme of the graph returned by the function.
Expand Down Expand Up @@ -322,7 +328,7 @@ plot_seromodel <- function(seromodel_object,
model_summary <- extract_seromodel_summary(seromodel_object = seromodel_object,
serodata = serodata)
summary_table <- t(
dplyr::select(model_summary,
dplyr::select(model_summary,
c('foi_model', 'dataset', 'elpd', 'se', 'converged')))
summary_plot <-
plot_info_table(summary_table, size_text = size_text)
Expand All @@ -333,7 +339,7 @@ plot_seromodel <- function(seromodel_object,
foi_plot,
rhats_plot,
ncol = 1,
nrow = 4,
nrow = 4,
rel_heights = c(0.5, 1, 1, 1)
)
}
Expand All @@ -358,7 +364,7 @@ plot_seromodel <- function(seromodel_object,
ggplot2::ylab(" ") +
ggplot2::xlab(" ")
g1 <- g0
# TODO: This
# TODO: This
g0 <- g0 + ggplot2::labs(subtitle = seromodel_object$model_name) +
ggplot2::theme(plot.title = ggplot2::element_text(size = 10))

Expand All @@ -369,7 +375,7 @@ plot_seromodel <- function(seromodel_object,
return(plot_arrange)
}

# TODO Improve documentation of @return.
# TODO Improve documentation of @return.
# TODO Give more details about the generated plot
#' Function that generates a plot for a given table
#'
Expand Down Expand Up @@ -399,4 +405,4 @@ plot_info_table <- function(info, size_text) {
fontface = "bold")

return(p)
}
}
Loading

0 comments on commit 6db956b

Please sign in to comment.