Skip to content

Commit

Permalink
Removed r-cmd-check warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jpavlich committed May 5, 2023
1 parent 80bbc2d commit ea1662a
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 8 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ Imports:
RcppParallel,
purrr,
cowplot,
jsonlite
jsonlite,
qtl
Suggests:
knitr,
rmarkdown
Expand Down
1 change: 1 addition & 0 deletions R/chagas2012.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# TODO Check if we really need to have the package `qtl` installed. Otherwise remove all entries of the form `see \code{\link[qtl]...`
#' Seroprevalence data on serofoi
#'
#' Data from a serological surveys
Expand Down
9 changes: 7 additions & 2 deletions R/modelling.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# TODO Complete @param documentation


#' Function that runs the specified stan model for the Force-of-Infection and estimates de seroprevalence based on the result of the fit
#'
#' This function runs the specified model for the Force-of-Infection \code{foi_model} using the data froma seroprevalence survey
Expand Down Expand Up @@ -36,6 +39,7 @@
#' For further details refer to the \code{control} parameter in \link[rstan]{sampling} or \href{https://mc-stan.org/rstanarm/reference/adapt_delta.html}{here}.
#' @param m_treed Maximum tree depth for the binary tree used in the NUTS stan sampler. For further details refer to the \code{control} parameter in \link[rstan]{sampling}.
#' @param decades Number of decades covered by the survey data.
#' @param print_summary TBD
#' @return \code{seromodel_object}. An object containing relevant information about the implementation of the model. For further details refer to \link{fit_seromodel}.
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -385,14 +389,15 @@ extract_seromodel_summary <- function(seromodel_object) {
return(model_summary)
}


# TODO Complete @param documentation
#' Function that generates an object containing the confidence interval based on a
#' Force-of-Infection fitting
#'
#' This function computes the corresponding binomial confidence intervals for the obtained prevalence based on a fitting
#' of the Force-of-Infection \code{foi} for plotting an analysis purposes.
#' @param serodata A data frame containing the data from a seroprevalence survey. For further details refer to \link{run_seromodel}.
#' @param foi Object containing the information of the force of infection. It is obtained from \code{rstan::extract(seromodel_object$fit, "foi", inc_warmup = FALSE)[[1]]}.
#' @param serodata A data frame containing the data from a seroprevalence survey. For further details refer to \link{run_seromodel}.
#' @param bin_data TBD
#' @return \code{prev_final}. The expanded prevalence data. This is used for plotting purposes in the \code{visualization} module.
#' @examples
#' \dontrun{
Expand Down
6 changes: 5 additions & 1 deletion R/seroprevalence_data.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# TODO Complete @param documentation


#' Function that prepares the data from a serological survey for modelling
#'
#' This function adds the necessary additional variables to the given dataset \code{serodata} corresponding to a serological survey.
Expand All @@ -14,7 +17,8 @@
#' \code{test} \tab The type of test taken \cr \tab \cr
#' \code{antibody} \tab antibody \cr \tab \cr
#' }
#' @param alpha probability of a type I error. For further details refer to \link{Hmisc::binconf}.
#' @param alpha probability of a type I error. For further details refer to \link[Hmisc]{binconf}.
#' @param add_age_mean_f TBD
#' @return serodata with additional columns necessary for the analysis. These columns are:
#' \tabular{ll}{
#' \code{age_mean_f} \tab Floor value of the average between age_min and age_max \cr \tab \cr
Expand Down
12 changes: 10 additions & 2 deletions R/visualisation.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,17 @@ plot_seroprev_fitted <- function(seromodel_object,
return(prev_plot)
}

# TODO Complete @param documentation

#' 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.
#' The x axis corresponds to the decades covered by the survey the y axis to the Force-of-Infection.
#' @param seromodel_object Object containing the results of fitting a model by means of \link{run_seromodel}.
#' @param size_text Text size use in the theme of the graph returned by the function.
#' @param max_lambda TBD
#' @param foi_sim TBD
#' @return A ggplot2 object containing the Force-of-infection-vs-time including the corresponding confidence interval.
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -278,12 +282,15 @@ plot_rhats <- function(seromodel_object,
return(rhats_plot)
}

# TODO Complete @param documentation

#' Function that generates a vertical arrange of plots showing a summary of a model, the estimated seroprevalence,
#' the Force-of-Infection fit and the R-hat estimates plots.
#'
#' @param seromodel_object Object containing the results of fitting a model by means of \link{run_seromodel}.
#' @param size_text Text size use in the theme of the graph returned by the function.
#' @param max_lambda TBD
#' @param foi_sim TBD
#' @return A ggplot object with a vertical arrange containing the seropositivity, force of infection, and convergence plots.
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -362,12 +369,13 @@ plot_seromodel <- function(seromodel_object,
return(plot_arrange)
}


# TODO Improve documentation of @return.
# TODO Give more details about the generated plot
#' Function that generates a plot for a given table
#'
#' @param info the information that will be contained in the table
#' @param size_text Text size of the graph returned by the function
#' @return p, a variable that will be used in the \link{visualisation} module
#' @return p the plot for the given table
#' @examples
#' \dontrun{
#' data_test <- prepare_serodata(serodata)
Expand Down
2 changes: 2 additions & 0 deletions man/get_prev_expanded.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/plot_foi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plot_info_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/plot_seromodel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/prepare_serodata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/run_seromodel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea1662a

Please sign in to comment.