Skip to content

Commit

Permalink
0-0-0 check for arrows addition
Browse files Browse the repository at this point in the history
  • Loading branch information
rdboyes committed Nov 18, 2020
1 parent 5322c7a commit 34eac07
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ Imports:
here,
rlang,
systemfonts,
extrafont
extrafont,
tibble
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Generated by roxygen2: do not edit by hand

export(forestable)
importFrom(graphics,text)
importFrom(rlang,.data)
6 changes: 3 additions & 3 deletions R/forestable.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#'
#' @return image
#' @importFrom rlang .data
#' @importFrom graphics text
#' @export
#'
#' @examples
forestable <- function(left_side_data, estimate, ci_low, ci_high,
right_side_data = NULL,
theme = NULL,
estimate_precision = 1,
ggplot_width = 30,
null_line_at = 0,
Expand Down Expand Up @@ -252,9 +252,9 @@ forestable <- function(left_side_data, estimate, ci_low, ci_high,

# create the arrow/label ggplot object
arrows_plot <- ggplot2::ggplot() +
ggplot2::geom_segment(data = arrow_df, ggplot2::aes(x = xstart, xend = xend, y = y, yend = y),
ggplot2::geom_segment(data = arrow_df, ggplot2::aes(x = .data$xstart, xend = .data$xend, y = .data$y, yend = .data$y),
arrow = ggplot2::arrow(angle = 15, type = "closed", length = grid::unit(0.1, "in"))) +
ggplot2::geom_text(data = xlab_df, ggplot2::aes(x = x, y = y, label = text, hjust = hjust),
ggplot2::geom_text(data = xlab_df, ggplot2::aes(x = .data$x, y = .data$y, label = .data$text, hjust = .data$hjust),
family = font_family, size = 3) +
ggplot2::scale_y_continuous(expand = c(0,0), limits = c(-0.5, 1.75)) +
ggplot2::scale_x_continuous(expand = c(0,0), limits = xlim) +
Expand Down
49 changes: 29 additions & 20 deletions man/forestable.Rd

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

4 comments on commit 34eac07

@yhenson
Copy link

@yhenson yhenson commented on 34eac07 Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This an excellent job!! But why mistakes occured: 'inset_element' is not an exported object from 'namespace:patchwork' when forestable were used?

@rdboyes
Copy link
Owner Author

@rdboyes rdboyes commented on 34eac07 Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inset_element is a new addition to patchwork - you might need to update to the latest version?

@yhenson
Copy link

@yhenson yhenson commented on 34eac07 Jan 9, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdboyes
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend using the current major version of R (4.X.Y). inset_element was added to patchwork in patchwork v1.1.0, so you'll need that version or later.

Please sign in to comment.