diff --git a/R/ds.acmPlot.R b/R/ds.acmPlot.R index c319328..e1d55d6 100644 --- a/R/ds.acmPlot.R +++ b/R/ds.acmPlot.R @@ -1,13 +1,6 @@ #' @title Client-side function to generate hazard ratio plots in DataSHIELD -#' @description This function creates a ggplot visualization for hazard ratio analysis -#' by getting the prediction data from the server-side acmPlotDS function. -#' -#' @details This function takes a prediction object created by ds.Predict and generates -#' a customizable ggplot visualization. The function allows customization of colors, -#' line sizes, axis labels, and more. -#' -#' -#' +#' @description Builds a ggplot hazard ratio curve per study using prediction data retrieved from a server-side prediction object. +#' @details This function calls the server-side aggregate function to retrieve summarized prediction data for a named server-side object, then builds one ggplot2 plot per study locally in R using ggplot2::ggplot, geom_line, geom_hline, and related layers. It also relies on the rms package being available locally for plotting support. Server function called: `acmPlotDS`. #' @param pred_obj character string specifying the name of prediction object on the server-side #' created using ds.Predict() #' @param outcome_name character string specifying the outcome name (e.g., "ACM", "CVD") (default: "ACM") @@ -15,12 +8,12 @@ #' @param line_size size of the main line (default: 2) #' @param ref_line_color color for the reference line (default: "brown") #' @param ref_line_size size of the reference line (default: 1.5) -#' @param x_breaks numeric vector for x-axis breaks (optional) +#' @param x_breaks Optional numeric vector of x-axis tick positions; if NULL, breaks are computed automatically as five evenly spaced values across the observed x range for each study. #' @param x_label label for x-axis (default: "Primary exposure") #' @param y_label label for y-axis (default: "Hazard ratio") #' @param event_n number of events (optional) #' @param datasources a list of \code{\link{DSConnection-class}} objects obtained after login -#' @return a list of ggplot objects from each study +#' @return Returns a plain R list of ggplot objects, one per study/data source, built from the aggregated prediction data; no additional disclosure control is applied within this function since only already-aggregated summary data is used for plotting. #' @author Xavier EscribĂ  Montagut, 2025 #' @examples #' \dontrun{