Skip to content

Commit

Permalink
clean up the help docs
Browse files Browse the repository at this point in the history
  • Loading branch information
n8thangreen committed Nov 9, 2023
1 parent 0d40e0a commit b8e8f1e
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 37 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BugReports: https://github.com/ICON-in-R/NMA/issues
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3.9000
Depends:
R (>= 3.5.0)
Imports:
Expand Down
7 changes: 4 additions & 3 deletions R/NMA_run.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

#' Run network meta-analysis
#'
#' BUGS code is taken from DSU reports and papers.
#' Calling BUGS an NMA is run using the `nma` object created by `new_NMA()`.
#' The BUGS code is taken from DSU reports and papers.
#'
#' The survival analysis data used is from the \insertCite{Woods2010}{NMA} model.
#'
Expand All @@ -10,10 +11,10 @@
#' @param save Save BUGS output to file? Logical
#' @importFrom Rdpack reprompt
#'
#' @return \code{res_bugs}
#' @return `res_bugs`
#' @export
#' @name NMA_run
#' @seealso \code{\link{new_NMA}}, \code{\link{NMA_update}}
#' @seealso `new_NMA()`, `NMA_update()`
#'
#' @references
#' \insertAllCited{}
Expand Down
9 changes: 5 additions & 4 deletions R/NMA_update.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@

#' Update NMA
#'
#' Take an existing analysis and modify it.
#'
#'
#' Take an existing NMA analysis created with an `nma` object, modify the input
#' arguments and rerun it.
#'
#' @template args-nma
#' @param ... Additional arguments
#'
#' @return
#' @export
#' @name NMA_update
#' @seealso \code{\link{new_NMA}}, \code{\link{NMA_run}}
#' @seealso `new_NMA()`, `NMA_run()`
#'
NMA_update <- function(nma, ...) {
UseMethod("NMA_update", nma)
Expand Down
2 changes: 1 addition & 1 deletion R/bugs_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param effectParam text vector of names
#' @param random RE or FE
#'
#' @return
#' @return List
#' @export
#'
bugs_stats <- function(dat,
Expand Down
3 changes: 2 additions & 1 deletion R/check_study_data.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#
#' Check study data
#'
check_study_data <- function(survDataHR = NA,
survDataMed = NA,
survDataBin = NA,
Expand Down
4 changes: 3 additions & 1 deletion R/make_labels.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

#'
#' Make labels
#' @return list
#'
make_labels <- function(label) {

# Short label without spaces
Expand Down
20 changes: 10 additions & 10 deletions R/make_report.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@

#' Make Report
#'
#' Constructs the automated report from the output of the NMA.
#'
#' @param ext A string of text to indicate the extension of the
#' resulting output file. Possible options are \code{"pdf"}, \code{"docx"}.
#' This requires the use of pandoc, knitr and rmarkdown.
#' @param echo A string (default to \code{FALSE}) to instruct whether
#' the report should also include the \code{BCEA} commands used to
#' produce the analyses. If the optional argument \code{echo} is set
#' to \code{TRUE} (default = \code{FALSE}), then the commands are also
#' printed.
#' Constructs an automated report from the output of the NMA.
#'
#' @param ext A string of text to indicate the extension of the resulting output
#' file. Possible options are `"pdf"`, `"docx"`. This requires the use of
#' pandoc, knitr and rmarkdown.
#' @param echo A string (default to `FALSE`) to instruct whether the report
#' should also include the `BCEA` commands used to produce the analyses. If
#' the optional argument `echo` is set to `TRUE` (default = `FALSE`), then the
#' commands are also printed.
#' @param ... Additional parameters.
#'
#' @importFrom fs path file_copy
Expand Down Expand Up @@ -130,6 +129,7 @@ make_report <- function(nma_model,
}

#' Allow disabling of the cat messages
#'
#' @param x Object to quietly return
#' @keywords internal
#'
Expand Down
2 changes: 1 addition & 1 deletion R/my_bugs_summary.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#' summStat
#' Summary statistics
#'
#' @param x x
#' @param probs Probabilities
Expand Down
22 changes: 12 additions & 10 deletions R/new_NMA.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@

#' NMA constructor
#'
#' Create an `nma` class object to use in an analysis. All of the data
#' types are optional but at least one needs to be passed to the function. The
#' `data_type` must be a subset of the passed data sets. If none given then all
#' of the supplied data are assumed.
#'
#' Create an \code{nma} class object to use in an analysis.
#' All of the data types are optional but at least one needs to be
#' passed to the function. The `data_type` must be a subset of
#' the passed data sets. If none given then all of the supplied
#' data are assumed.
#' @section Different data types:
#'
#' The data types are split in to two: survival data and other.
#'
#' @param survDataHR Hazard ratio input data frame. Optional
#' @param survDataMed Median time input data frame. Optional
#' @param survDataBin Survival binary data input data frame. Optional
Expand All @@ -15,18 +18,17 @@
#' @param contsData Continuous data input data frame. Optional
#' @param bugs_params List of BUGS parameters. Optional
#' @param is_random Random effects model? Logical
#' @param data_type Vector of names of data formats from
#' "hr_data", "surv_bin_data", "med_data", "bin_data",
#' "count_data", "conts_data"
#' @param data_type Vector of names of data formats from "hr_data",
#' "surv_bin_data", "med_data", "bin_data", "count_data", "conts_data"
#' @param hyperparams List of hyperparameters
#' @param refTx Reference treatment; string
#' @param effectParam Effect parameter
#' @param label Label
#' @param endpoint End point name; string
#' @seealso \code{\link{NMA_run}}, \code{\link{NMA_update}}
#' @seealso [NMA_run()], [NMA_update()]
#' @return
#' @export
#'
#'
new_NMA <- function(survDataHR = NA,
survDataMed = NA,
survDataBin = NA,
Expand Down
7 changes: 5 additions & 2 deletions R/new_NMA_dir.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

#' Load all input data from a folder
#'
#' Rather than script the prepocessing, read in data from a folder containing a
#' `REFERENCE` file telling R what and where the different input data file are.
#'
#' @param data_dir folder location; string
#' @return \code{nma} object
#' @return `nma` object
#' @importFrom fs path
#'
#'
#' @export
#'
new_NMA_dir <- function(data_dir = ".") {
Expand Down
2 changes: 1 addition & 1 deletion R/nma_helper.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#' nma helper
#' nma helper to validate NMA
#'
#' @return
#' @export
Expand Down
1 change: 1 addition & 0 deletions R/nma_outputs.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

#' Diagnostics
#' @keywords internal
#'
diagnostics <- function(res_bugs,
Expand Down
2 changes: 1 addition & 1 deletion R/plots_and_tables.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#' Write to file multiple NMA plots and tables
#'
#' @param dat ist of study data, including subData
#' @param dat List of study data, including subData
#' and possibly survDataBin and survDataMed
#' @param res_bugs BUGS output
#' @param effectParam Effect parameter names; string
Expand Down
2 changes: 1 addition & 1 deletion R/prep_codeData.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#' Prepare data used in computation
#' Prepare data used in NMA computation
#'
#' Create input data for NMA.
#' Renames the study, base and other fields with appended letter
Expand Down

0 comments on commit b8e8f1e

Please sign in to comment.