Skip to content

Commit

Permalink
Converted parameters to lower case with full stop
Browse files Browse the repository at this point in the history
  • Loading branch information
gowerc committed Oct 6, 2023
1 parent 719a0a7 commit fc853a5
Show file tree
Hide file tree
Showing 23 changed files with 112 additions and 110 deletions.
12 changes: 6 additions & 6 deletions R/DataJoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ as.list.DataJoint <- function(x, ...) {

#' Subsetting `DataJoint` as a `data.frame`
#'
#' @param x (`DataJoint`) \cr A [DataJoint][DataJoint-class] object created by [DataJoint()]
#' @param patients (`character` or `list`)\cr the patients that you wish to subset the `data.frame`
#' @param x (`DataJoint`) \cr object created by [DataJoint()].
#' @param patients (`character` or `list`)\cr patients that you wish to subset the `data.frame`
#' to contain. See details.
#' @param ... Not used.
#'
Expand Down Expand Up @@ -128,9 +128,9 @@ subset.DataJoint <- function(x, patients, ...) {

#' `subset_and_add_grouping`
#'
#' @param dat (`data.frame`) \cr Must have a column called `patient` which corresponds to the
#' values passed to `groupings`
#' @param groupings (`character` or `list`)\cr the patients that you wish to subset the dataset
#' @param dat (`data.frame`) \cr must have a column called `patient` which corresponds to the
#' values passed to `groupings`.
#' @param groupings (`character` or `list`)\cr patients that you wish to subset the dataset
#' to contain. If `groupings` is a list then an additional variable `group` will be added
#' onto the dataset specifying which group the row belongs to.
#'
Expand Down Expand Up @@ -167,7 +167,7 @@ subset_and_add_grouping <- function(dat, groupings) {
#' Extract Observed Longitudinal Values
#'
#' Utility function to extract the observed longitudinal values from a [`DataJoint`] object
#' @param object ([`DataJoint`])\cr The data used to fit a [`JointModel`]
#' @param object ([`DataJoint`])\cr data used to fit a [`JointModel`].
#' @return A data.frame with the following columns
#' - `subject` (`character`)\cr The subject identifier
#' - `time` (`numeric`)\cr The time at which the observation occurred
Expand Down
20 changes: 10 additions & 10 deletions R/LongitudinalQuantities.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ NULL
#'
#' Constructor function to generate a `LongitudinalQuantities` object.
#'
#' @param object ([`JointModelSamples`]) \cr Samples as drawn from a Joint Model
#' @param object ([`JointModelSamples`]) \cr samples as drawn from a Joint Model.
#'
#' @param groups (`character`, `NULL`)\cr which patients to calculate the desired
#' quantities for.
#'
#' @param time_grid (`numeric` or `NULL`)\cr a vector of time points to calculate the desired
#' quantity at. If `NULL` will be set to `seq(0, max_longitudinal_time, length = 201)`
#' quantity at. If `NULL` will be set to `seq(0, max_longitudinal_time, length = 201)`.
#'
#' @details
#' Note that unlike [SurvivalQuantities], [LongitudinalQuantities] does not support
Expand Down Expand Up @@ -82,8 +82,8 @@ LongitudinalQuantities <- function(

#' `as.data.frame`
#'
#' @param x ([`LongitudinalQuantities`]) \cr Longitudinal Quantities
#' @param ... Not used
#' @param x ([`LongitudinalQuantities`]) \cr longitudinal quantities.
#' @param ... not used.
#' @family LongitudinalQuantities
#' @export
as.data.frame.LongitudinalQuantities <- function(x, ...) {
Expand All @@ -105,7 +105,7 @@ as.data.frame.LongitudinalQuantities <- function(x, ...) {
#' @description
#' This method returns a `data.frame` of the longitudinal quantities
#'
#' @param object ([`LongitudinalQuantities`]) \cr Survival Quantities.
#' @param object ([`LongitudinalQuantities`]) \cr longitudinal quantities.
#' @param conf.level (`numeric`) \cr confidence level of the interval.
#' @param ... Not used.
#'
Expand Down Expand Up @@ -135,9 +135,9 @@ summary.LongitudinalQuantities <- function(
#' This function predominately exists to extract core logic into its own function
#' to enable easier unit testing.
#'
#' @param data (`data.frame`)\cr A `data.frame` of summary statistics for longitudinal
#' @param data (`data.frame`)\cr summary statistics for longitudinal
#' value estimates. See details.
#' @param data_obs (`data.frame`)\cr A `data.frame` of real observed values to be
#' @param data_obs (`data.frame`)\cr real observed values to be
#' overlaid for reference. See details.
#' @param add_ci (`logical`)\cr Should confidence intervals be added? Default = `TRUE`.
#' @details
Expand Down Expand Up @@ -185,10 +185,10 @@ longitudinal_plot <- function(

#' Automatic Plotting for LongitudinalQuantities
#'
#' @param object ([`LongitudinalQuantities`]) \cr Longitudinal Quantities
#' @param object ([`LongitudinalQuantities`]) \cr longitudinal quantities.
#' @param conf.level (`numeric`) \cr confidence level of the interval. If values of `FALSE`,
#' `NULL` or `0` are provided then confidence regions will not be added to the plot
#' @param ... Not used.
#' `NULL` or `0` are provided then confidence regions will not be added to the plot.
#' @param ... not used.
#'
#' @family LongitudinalQuantities
#' @family autoplot
Expand Down
37 changes: 19 additions & 18 deletions R/Quantities.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#' A simple wrapper around a `list` to ensure each element complies
#' to specific formatting rules
#'
#' @param x (`list`)\cr A `list` of `matrix` objects. Each matrix must have the exact
#' same dimensions
#' @param x (`list`)\cr a `list` of `matrix` objects. Each matrix must have the exact
#' same dimensions.
#'
#' @keywords internal
#' @name Quantities-class
Expand Down Expand Up @@ -47,7 +47,7 @@ setValidity(

#' Dimensions of `Quantitites`
#'
#' @param x ([`Quantities`]) \cr Any generated model quantity
#' @param x ([`Quantities`]) \cr generated quantities.
#'
#' Returns the number of rows and columns within any given
#' element of the [Quantities] object. As each element is of the same
Expand All @@ -71,11 +71,11 @@ dim.Quantities <- function(x) {

#' `Quantities` -> `data.frame`
#'
#' @param x ([`Quantities`]) \cr Any generated model quantity
#' @param time_grid (`numeric`)\cr Sets the `time` variable. Must be equal in length to `ncol(x)`
#' @param type (`character`)\cr Sets the `type` variable.
#' @param groups (`list`)\cr Named `list`. The element names are used to set the `group` variable
#' @param ... Not used
#' @param x ([`Quantities`]) \cr generated quantities.
#' @param time_grid (`numeric`)\cr sets the `time` variable. Must be equal in length to `ncol(x)`.
#' @param type (`character`)\cr sets the `type` variable.
#' @param groups (`list`)\cr named `list`. The element names are used to set the `group` variable.
#' @param ... not used.
#'
#' @keywords internal
#' @family Quantities
Expand Down Expand Up @@ -116,12 +116,13 @@ as.data.frame.Quantities <- function(x, ..., time_grid, type, groups) {
#' is just an internal utility method in order to share common code between
#' [LongitudinalQuantities] and [SurvivalQuantities]
#'
#' @param object ([`Quantities`]) \cr Any generated model quantity
#' @param time_grid (`numeric`)\cr Sets the `time` variable. Must be equal in length to `ncol(object)`
#' @param type (`character`)\cr Sets the `type` variable.
#' @param groups (`list`)\cr Named `list`. The element names are used to set the `group` variable
#' @param object ([`Quantities`]) \cr generated quantities.
#' @param time_grid (`numeric`)\cr sets the `time` variable.
#' Must be equal in length to `ncol(object)`.
#' @param type (`character`)\cr sets the `type` variable.
#' @param groups (`list`)\cr named `list`. The element names are used to set the `group` variable.
#' @param conf.level (`numeric`) \cr confidence level of the interval.
#' @param ... Not used.
#' @param ... not used.
#'
#' @returns
#' A `data.frame` with the following variables:
Expand Down Expand Up @@ -168,13 +169,13 @@ summary.Quantities <- function(object, time_grid, type, groups, conf.level = 0.9
#' This function takes a [posterior::draws_matrix()] (matrix of cmdstanr sample draws) and extracts
#' the specified columns and aggregates them by calculating the pointwise average.
#'
#' @param subject_index (`numeric`)\cr Which subject indices to extract from `quantities`.
#' @param subject_index (`numeric`)\cr which subject indices to extract from `quantities`.
#' See details.
#'
#' @param time_index (`numeric`)\cr Which time point indices to extract from `quantities`.
#' @param time_index (`numeric`)\cr which time point indices to extract from `quantities`.
#' See details.
#'
#' @param quantities ([`posterior::draws_matrix`])\cr A matrix of sample draws.
#' @param quantities ([`posterior::draws_matrix`])\cr sample draws.
#' See details.
#'
#' @details
Expand Down Expand Up @@ -230,8 +231,8 @@ average_samples_by_index <- function(subject_index, time_index, quantities) {
#' Multiple quantities are generated by default so this is a convenience function to extract
#' the desired ones and return them them as a user friendly [posterior::draws_matrix] object
#'
#' @param gq (`CmdStanGQ`) \cr A [cmdstanr::CmdStanGQ] object created by [generateQuantities]
#' @param type (`character`)\cr The quantity to be generated.
#' @param gq (`CmdStanGQ`) \cr a [cmdstanr::CmdStanGQ] object created by [generateQuantities].
#' @param type (`character`)\cr quantity to be generated.
#' Must be one of `surv`, `haz`, `loghaz`, `cumhaz`, `lm_identity`.
#' @keywords internal
extract_quantities <- function(gq, type = c("surv", "haz", "loghaz", "cumhaz", "lm_identity")) {
Expand Down
42 changes: 21 additions & 21 deletions R/SurvivalQuantities.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ NULL
#'
#' Constructor function to generate a `SurvivalQuantities` object.
#'
#' @param object ([`JointModelSamples`]) \cr Samples as drawn from a Joint Model
#' @param object ([`JointModelSamples`]) \cr samples as drawn from a Joint Model.
#'
#' @param groups (`character` or `list` or `NULL`)\cr which patients to calculate the desired
#' quantities for.
#' See "Group Specification" for more details.
#'
#' @param type (`character`)\cr The quantity to be generated.
#' @param type (`character`)\cr quantity to be generated.
#' Must be one of `surv`, `haz`, `loghaz`, `cumhaz`.
#'
#' @param time_grid (`numeric` or `NULL`)\cr a vector of time points to calculate the desired
#' quantity at. If `NULL` will be set to `seq(0, max_survival_time, length = 201)`
#' @param time_grid (`numeric` or `NULL`)\cr vector of time points to calculate the desired
#' quantity at. If `NULL` will be set to `seq(0, max_survival_time, length = 201)`.
#'
#'
#' @slot quantities (`Quantities`)\cr The sampled quantities. Should contain 1 element per
Expand Down Expand Up @@ -130,9 +130,9 @@ setValidity(
#' @description
#' This method returns a `data.frame` of key quantities (survival / log-hazard / etc)
#'
#' @param object ([`SurvivalQuantities`]) \cr Survival Quantities.
#' @param object ([`SurvivalQuantities`]) \cr survival quantities.
#' @param conf.level (`numeric`) \cr confidence level of the interval.
#' @param ... Not used.
#' @param ... not used.
#'
#' @family SurvivalQuantities
#' @family summary
Expand All @@ -155,8 +155,8 @@ summary.SurvivalQuantities <- function(

#' `SurvivalQuantities` -> `data.frame`
#'
#' @param x ([`SurvivalQuantities`]) \cr Survival Quantities
#' @param ... Not used
#' @param x ([`SurvivalQuantities`]) \cr survival quantities.
#' @param ... not used.
#' @family SurvivalQuantities
#' @export
as.data.frame.SurvivalQuantities <- function(x, ...) {
Expand All @@ -171,14 +171,14 @@ as.data.frame.SurvivalQuantities <- function(x, ...) {

#' Automatic Plotting for LongitudinalQuantities
#'
#' @param object ([`SurvivalQuantities`]) \cr Survival Quantities
#' @param add_km (`logical`) \cr If `TRUE` Kaplan-Meier curves will be added to the plot for
#' each group/patient
#' @param add_wrap (`logical`) \cr If `TRUE` will apply a [ggplot2::facet_wrap()] to the plot
#' by each group/patient
#' @param object ([`SurvivalQuantities`]) \cr survival quantities.
#' @param add_km (`logical`) \cr if `TRUE` Kaplan-Meier curves will be added to the plot for
#' each group/patient.
#' @param add_wrap (`logical`) \cr if `TRUE` will apply a [ggplot2::facet_wrap()] to the plot
#' by each group/patient.
#' @param conf.level (`numeric`) \cr confidence level of the interval. If values of `FALSE`,
#' `NULL` or `0` are provided then confidence regions will not be added to the plot
#' @param ... Not Used.
#' @param ... not used.
#'
#' @family SurvivalQuantities
#' @family autoplot
Expand Down Expand Up @@ -225,15 +225,15 @@ autoplot.SurvivalQuantities <- function(object,
#' This function predominately exists to extract core logic into its own function
#' to enable easier unit testing.
#'
#' @param data (`data.frame`)\cr A `data.frame` of summary statistics for a survival
#' @param data (`data.frame`)\cr summary statistics for a survival
#' curve to be plotted. See details.
#' @param add_ci (`logical`)\cr Should confidence intervals be added? Default = `TRUE`.
#' @param add_wrap (`logical`)\cr Should the plots be wrapped by `data$group`? Default = `TRUE`.
#' @param kmdf (`data.frame` or `NULL`)\cr A `data.frame` of event times and status used to plot
#' @param add_ci (`logical`)\cr should confidence intervals be added? Default = `TRUE`.
#' @param add_wrap (`logical`)\cr should the plots be wrapped by `data$group`? Default = `TRUE`.
#' @param kmdf (`data.frame` or `NULL`)\cr event times and status used to plot
#' overlaying KM curves. If `NULL` no KM curve will be plotted. See details.
#' @param y_label (`character` or `expression`) \cr Label to display on the y-axis.
#' Default = `expression(S(t))`
#' @param x_label (`character` or `expression`) \cr Label to display on the x-axis.
#' @param y_label (`character` or `expression`) \cr label to display on the y-axis.
#' Default = `expression(S(t))`.
#' @param x_label (`character` or `expression`) \cr label to display on the x-axis.
#'
#' @details
#'
Expand Down
4 changes: 2 additions & 2 deletions man/LongitudinalQuantities-class.Rd

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

4 changes: 2 additions & 2 deletions man/Quantities-class.Rd

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

8 changes: 4 additions & 4 deletions man/SurvivalQuantities-class.Rd

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

4 changes: 2 additions & 2 deletions man/as.data.frame.LongitudinalQuantities.Rd

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

10 changes: 5 additions & 5 deletions man/as.data.frame.Quantities.Rd

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

4 changes: 2 additions & 2 deletions man/as.data.frame.SurvivalQuantities.Rd

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

6 changes: 3 additions & 3 deletions man/autoplot.LongitudinalQuantities.Rd

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

Loading

0 comments on commit fc853a5

Please sign in to comment.