Skip to content

Commit 842ba80

Browse files
committed
fix various check issues
1 parent ccfcc97 commit 842ba80

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ importFrom(ggplot2,is.ggplot)
101101
importFrom(ggplot2,is.theme)
102102
importFrom(ggplot2,labs)
103103
importFrom(ggplot2,margin)
104+
importFrom(ggplot2,max_height)
105+
importFrom(ggplot2,max_width)
104106
importFrom(ggplot2,panel_cols)
105107
importFrom(ggplot2,panel_rows)
106108
importFrom(ggplot2,scale_x_continuous)
@@ -140,6 +142,7 @@ importFrom(gtable,gtable_add_rows)
140142
importFrom(gtable,gtable_height)
141143
importFrom(gtable,gtable_width)
142144
importFrom(gtable,is.gtable)
145+
importFrom(stats,ave)
143146
importFrom(stats,na.omit)
144147
importFrom(utils,as.roman)
145148
importFrom(utils,modifyList)

R/collect_axes.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ collect_axes <- function(gt, dir = "x") {
136136
# For every given row, check if all non-zero grobs occupying that row have a
137137
# name that has a pattern. If all these grobs in that row do, measure the
138138
# grob heights and put that into the gtable's heights.
139+
#' @importFrom ggplot2 max_height
139140
retrofit_rows <- function(gt, rows, pattern = NULL) {
140141
if (is.null(pattern) || length(rows) == 0) {
141142
return(gt)
@@ -166,6 +167,7 @@ retrofit_rows <- function(gt, rows, pattern = NULL) {
166167
# For every given column, check if all non-zero grobs occupying that column
167168
# have a name that has a pattern. If all these grobs in that column do, measure
168169
# the grob widths and put that into the gtable's widths.
170+
#' @importFrom ggplot2 max_width
169171
retrofit_cols <- function(gt, cols, pattern = NULL) {
170172
if (is.null(pattern) || length(cols) == 0) {
171173
return(gt)
@@ -240,6 +242,7 @@ is_zero <- function(x) {
240242
}
241243

242244
# Determine uniqueness of grobs
245+
#' @importFrom stats ave
243246
grob_id <- function(grobs, layout, byrow, merge = FALSE) {
244247

245248
# Hash the grobs to determine unique grobs

R/inset_element.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@
3535
#' # Grobs and other objects can be added as insets as well
3636
#' p1 + inset_element(grid::circleGrob(), 0.4, 0.4, 0.6, 0.6)
3737
#'
38-
#' logo <- system.file('help', 'figures', 'logo.png', package = 'patchwork')
39-
#' logo <- png::readPNG(logo, native = TRUE)
40-
#' p1 + inset_element(logo, 0.8, 0.8, 1, 1, align_to = 'full')
38+
#' if (requireNamespace('png', quietly = TRUE)) {
39+
#' logo <- system.file('help', 'figures', 'logo.png', package = 'patchwork')
40+
#' logo <- png::readPNG(logo, native = TRUE)
41+
#' p1 + inset_element(logo, 0.8, 0.8, 1, 1, align_to = 'full')
42+
#' }
4143
#'
4244
#' # Just as expected insets are still amenable to changes after the fact
4345
#' p1 +

man/inset_element.Rd

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_layout.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)