Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

241: adding parameter to adjust dot size. #242

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions R/g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#' Default value is `ggplot2::waiver()`.
#' @param rotate_xlab boolean whether to rotate x-axis labels.
#' @param plot_font_size control font size for title, x-axis, y-axis and legend font.
#' @param dot_size plot dot size.
kartikeyakirar marked this conversation as resolved.
Show resolved Hide resolved
#' @param dodge control position dodge.
#' @param plot_height height of produced plot. 989 pixels by default.
#' @param count_threshold \code{integer} minimum number observations needed to show the appropriate
Expand Down Expand Up @@ -254,6 +255,7 @@ g_lineplot <- function(label = "Line Plot",
xlabel = xtick,
rotate_xlab = FALSE,
plot_font_size = 12,
dot_size = 3,
kartikeyakirar marked this conversation as resolved.
Show resolved Hide resolved
dodge = 0.4,
plot_height = 989,
count_threshold = 0,
Expand Down Expand Up @@ -405,7 +407,7 @@ g_lineplot <- function(label = "Line Plot",
)
) +
ggplot2::theme_bw() +
ggplot2::geom_point(position = pd) +
ggplot2::geom_point(position = pd, size = dot_size) +
ggplot2::scale_color_manual(
values = color_manual, name = trt_label, guide = ggplot2::guide_legend(ncol = 3, order = 1)
) +
Expand Down Expand Up @@ -443,7 +445,7 @@ g_lineplot <- function(label = "Line Plot",
ggplot2::scale_linetype_manual(" ", values = type_mapping, guide = ggplot2::guide_legend(ncol = 3, order = 1)) +
ggplot2::scale_shape_manual(" ", values = shape_mapping, guide = ggplot2::guide_legend(ncol = 3, order = 1)) +
ggplot2::theme(legend.key.size = grid::unit(1, "cm")) +
ggplot2::geom_point(position = pd, size = 3)
ggplot2::geom_point(position = pd, size = dot_size)
}

plot1 <- plot1 +
Expand Down
4 changes: 3 additions & 1 deletion R/g_spaghettiplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#' value is `ggplot2::waiver()`.
#' @param rotate_xlab boolean whether to rotate x-axis labels.
#' @param font_size control font size for title, x-axis, y-axis and legend font.
#' @param dot_size plot dot size.
#' @param group_stats control group mean or median overlay.
#' @param hline_arb ('numeric vector') value identifying intercept for arbitrary horizontal lines.
#' @param hline_arb_color ('character vector') optional, color for the arbitrary horizontal lines.
Expand Down Expand Up @@ -233,6 +234,7 @@ g_spaghettiplot <- function(data,
xlabel = xtick,
rotate_xlab = FALSE,
font_size = 12,
dot_size = 2,
group_stats = "NONE",
hline_arb = numeric(0),
hline_arb_color = "red",
Expand Down Expand Up @@ -288,7 +290,7 @@ g_spaghettiplot <- function(data,
data = plot_data,
ggplot2::aes(x = !!sym(time), y = !!sym(value_var), color = !!sym(trt_group), group = !!sym(subj_id))
) +
ggplot2::geom_point(size = 0.8, na.rm = TRUE, ggplot2::aes(shape = !!sym(loq_flag_var))) +
ggplot2::geom_point(size = dot_size, na.rm = TRUE, ggplot2::aes(shape = !!sym(loq_flag_var))) +
ggplot2::geom_line(linewidth = 0.4, alpha = alpha, na.rm = TRUE) +
ggplot2::facet_wrap(trt_group, ncol = facet_ncol, scales = facet_scales) +
ggplot2::labs(caption = caption_loqs_label) +
Expand Down
3 changes: 3 additions & 0 deletions man/g_lineplot.Rd

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

3 changes: 3 additions & 0 deletions man/g_spaghettiplot.Rd

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

Loading