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

addign x y axis limit, good to go #187

Merged
merged 6 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# tern.mmrm 0.3.1.9004

### Miscellaneous

Added `xlimits` and `ylimits` arguments to the `g_mmrm_lsmeans` function.

# tern.mmrm 0.3.1

### Miscellaneous
Expand Down
7 changes: 6 additions & 1 deletion R/g_mmrm.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ g_mmrm_diagnostic <- function(object,
#' @param titles (`character`)\cr with elements `estimates` and `contrasts` containing the plot titles.
#' @param xlab (`string`)\cr the x axis label.
#' @param ylab (`string`)\cr the y axis label.
#' @param xlimits (`numeric`)\cr x axis limits.
#' @param ylimits (`numeric`)\cr y axis limits.
#' @param width (`numeric`)\cr width of the error bars.
#' @param show_pval (`flag`)\cr should the p-values for the differences of
#' LS means vs. control be displayed (not default)?
Expand Down Expand Up @@ -273,6 +275,8 @@ g_mmrm_lsmeans <-
),
xlab = object$labels$visit,
ylab = paste0("Estimates with ", round(object$conf_level * 100), "% CIs"),
xlimits = NULL,
ylimits = NULL,
width = 0.6,
show_pval = TRUE,
show_lines = FALSE,
Expand Down Expand Up @@ -437,7 +441,8 @@ g_mmrm_lsmeans <-
nrow = length(select),
scales = "free_y", # Since estimates and contrasts need to have different y scales.
labeller = ggplot2::as_labeller(titles)
)
) +
ggplot2::coord_cartesian(ylim = ylimits, xlim = xlimits)
if (show_lines) {
result <- result +
ggplot2::geom_line(position = pd)
Expand Down
6 changes: 6 additions & 0 deletions man/g_mmrm_lsmeans.Rd

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

Loading