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

Implement static forest plot #47

Merged
merged 10 commits into from
May 15, 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
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Authors@R: c(
person("Yujie", "Zhao", role = c("aut")),
person("Nan", "Xiao", role = c("ctb")),
person("Hiroaki", "Fukuda", role = c("ctb")),
person("Yulia", "Sidi", role = c("ctb")),
person("Xuan", "Deng", role = c("ctb")),
person("Merck & Co., Inc., Rahway, NJ, USA and its affiliates", role = "cph")
)
Expand All @@ -32,15 +33,17 @@ Imports:
metalite.ae,
reactable,
reactR,
rlang
rlang,
ggplot2
Suggests:
covr,
dplyr,
knitr,
r2rtf,
rmarkdown,
patchwork,
testthat (>= 3.0.0)
VignetteBuilder: knitr
Config/testthat/edition: 3
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
31 changes: 31 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
# Generated by roxygen2: do not edit by hand

export(ae_forestly)
export(background_panel)
export(format_ae_forestly)
export(meta_forestly)
export(plot_dot)
export(plot_errorbar)
export(prepare_ae_forestly)
export(table_panel)
export(theme_panel)
importFrom(ggplot2,aes)
importFrom(ggplot2,annotate)
importFrom(ggplot2,dup_axis)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,element_line)
importFrom(ggplot2,element_rect)
importFrom(ggplot2,element_text)
importFrom(ggplot2,geom_errorbar)
importFrom(ggplot2,geom_point)
importFrom(ggplot2,geom_rect)
importFrom(ggplot2,geom_vline)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,guide_legend)
importFrom(ggplot2,guides)
importFrom(ggplot2,margin)
importFrom(ggplot2,scale_colour_manual)
importFrom(ggplot2,scale_shape_manual)
importFrom(ggplot2,scale_x_continuous)
importFrom(ggplot2,scale_x_discrete)
importFrom(ggplot2,scale_y_discrete)
importFrom(ggplot2,sec_axis)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_minimal)
importFrom(ggplot2,xlab)
importFrom(ggplot2,ylab)
importFrom(utils,tail)
2 changes: 1 addition & 1 deletion R/ae_forestly.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ae_forestly <- function(outdata, filter = c("prop", "n"), width = 1400) {
labels <- lapply(t_details, function(x) attr(x, "label"))

# Create named column definitions using the labels
col_defs <- setNames(
col_defs <- stats::setNames(
lapply(names(t_details), function(name) {
# Use label from the list
label_name <- if(is.null(labels[[name]])) name else labels[[name]][[1]]
Expand Down
28 changes: 28 additions & 0 deletions R/globals.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2024 Merck & Co., Inc., Rahway, NJ, USA and its affiliates.
# All rights reserved.
#
# This file is part of the forestly program.
#
# forestly is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

utils::globalVariables(
unique(
c(
# From `plot_dot()`
c(".data"),
# From `plot_errorbar()`
c(".data", "x1", "x2", "x3", "y")
)
)
)
Loading