Skip to content

Commit f5b77f5

Browse files
committed
Fix bug with default vline_type
1 parent 13964cd commit f5b77f5

File tree

5 files changed

+34
-15
lines changed

5 files changed

+34
-15
lines changed

R/maraca.R

+15-6
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,11 @@ print.maraca <- function(x, ...) {
269269
#' The accepted values are the same that ggplot2::scale_x_continuous
270270
#' @param density_plot_type which type of plot to display in the continuous
271271
#' part of the plot. Options are "default", "violin", "box", "scatter".
272-
#' @param vline_type what the vertical lines in the continuous part of the plot
273-
#' should highlight. Options are "median", "mean", "none".
272+
#' @param vline_type what the vertical dashed line should represent. Accepts
273+
#' "median" (only for continuous last endpoint), "mean", "none" and
274+
#' NULL (default). By default (vline_type = NULL), vline_type will be
275+
#' set to "median" for a continuous last endpoint and to "mean" for
276+
#' a binary last endpoint.
274277
#' @param theme Choose theme to style the plot. The default theme is "maraca".
275278
#' Options are "maraca", "maraca_old", "color1", "color2" and none".
276279
#' For more details, check the vignette called
@@ -709,7 +712,10 @@ validate_maraca_plot <- function(x, ...) {
709712
#' @param density_plot_type The type of plot to use to represent the density.
710713
#' Accepts "default", "violin", "box" and "scatter".
711714
#' @param vline_type what the vertical dashed line should represent. Accepts
712-
#' "median", "mean", "none".
715+
#' "median" (only for continuous last endpoint), "mean", "none" and
716+
#' NULL (default). By default (vline_type = NULL), vline_type will be
717+
#' set to "median" for a continuous last endpoint and to "mean" for
718+
#' a binary last endpoint.
713719
#' @param theme Choose theme to style the plot. The default theme is "maraca".
714720
#' Options are "maraca", "maraca_old", "color1", "color2" and none".
715721
#' For more details, check the vignette called
@@ -733,7 +739,7 @@ validate_maraca_plot <- function(x, ...) {
733739
plot.maraca <- function(
734740
x, continuous_grid_spacing_x = 10, trans = "identity",
735741
density_plot_type = "default",
736-
vline_type = "median",
742+
vline_type = NULL,
737743
theme = "maraca",
738744
...) {
739745
plot_maraca(x, continuous_grid_spacing_x,
@@ -760,7 +766,10 @@ plot.maraca <- function(
760766
#' @param density_plot_type The type of plot to use to represent the density.
761767
#' Accepts "default", "violin", "box" and "scatter".
762768
#' @param vline_type what the vertical dashed line should represent. Accepts
763-
#' "median", "mean", "none".
769+
#' "median" (only for continuous last endpoint), "mean", "none" and
770+
#' NULL (default). By default (vline_type = NULL), vline_type will be
771+
#' set to "median" for a continuous last endpoint and to "mean" for
772+
#' a binary last endpoint.
764773
#' @param fixed_followup_days Not needed if HCE object contains information
765774
#' on fixed follow-up days in the study
766775
#' (column PADY or TTEfixed,
@@ -803,7 +812,7 @@ plot.hce <- function(x, last_outcome = "C",
803812
continuous_grid_spacing_x = 10,
804813
trans = "identity",
805814
density_plot_type = "default",
806-
vline_type = "median",
815+
vline_type = NULL,
807816
fixed_followup_days = NULL,
808817
compute_win_odds = FALSE,
809818
step_types = "tte",

man/maraca.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot.hce.Rd

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot.maraca.Rd

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_maraca.Rd

+7-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)