Skip to content

Commit

Permalink
doc: improve gen_grob manual
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgohel committed Mar 5, 2024
1 parent a24947d commit 7bdedbd
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions R/grid_grobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
#'
#' @return a grob (gTree) object made with package `grid`
#' @examples
#' \dontshow{
#' data.table::setDTthreads(1)
#' }
#' library(ragg)
#' library(gdtools)
#' register_liberationsans()
Expand Down Expand Up @@ -110,6 +113,28 @@
#' )
#' plot(gr)
#' dev.off()
#'
#'
#' if (require("ggplot2")) {
#' png_f_3 <- tempfile(fileext = ".png")
#' z <- summarizor(iris, by = "Species") |>
#' as_flextable(spread_first_col = TRUE) |>
#' color(color = "gray", part = "all")
#' gg <- ggplot(data = iris, aes(Sepal.Length, Petal.Width)) +
#' annotation_custom(
#' gen_grob(z, scaling = "full"),
#' xmin = 4.5, xmax = 7.5, ymin = 0.25, ymax = 2.25) +
#' geom_point() +
#' theme_minimal()
#' ragg::agg_png(
#' filename = png_f_3, width = 7,
#' height = 7, units = "in", res = 150
#' )
#' print(gg)
#' dev.off()
#' }
#'
#'
#' @family flextable print function
#' @importFrom grid gTree
gen_grob <- function(x,
Expand Down
25 changes: 25 additions & 0 deletions man/gen_grob.Rd

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

0 comments on commit 7bdedbd

Please sign in to comment.