Skip to content

Commit

Permalink
Add missing importFrom statements related to graphics.
Browse files Browse the repository at this point in the history
Fix option naming in documentation

Address ggplot2's global variable name scope hiccup...
  • Loading branch information
coatless committed Jan 11, 2024
1 parent d31378a commit 10a7cef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@

export(draw_matrix)
export(gdraw_matrix)
importFrom(graphics,mtext)
importFrom(graphics,par)
importFrom(graphics,plot.new)
importFrom(graphics,plot.window)
importFrom(graphics,rect)
importFrom(graphics,text)
9 changes: 6 additions & 3 deletions R/matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' cells should be filled. Default: None.
#' @param highlight_color Color to use to fill the background of a cell.
#'
#' @importFrom graphics rect text
#' @importFrom graphics rect text mtext par plot.new plot.window
#' @rdname draw-matrix
#' @export
#' @examples
Expand All @@ -23,7 +23,7 @@
#' draw_matrix(mat_3x3)
#'
#' # Disable the indices
#' draw_matrix(mat_3x3, show_indices = FALSE)
#' draw_matrix(mat_3x3, show_cell_indices = FALSE)
#'
#' # Highlight a row
#' mat_2x2 = matrix(c(1, 2, 3, 4), nrow = 2)
Expand Down Expand Up @@ -138,7 +138,7 @@ draw_matrix <- function(
#' gdraw_matrix(mat_3x3)
#'
#' # View the matrix without indices present
#' gdraw_matrix(mat_3x3, show_indices = FALSE)
#' gdraw_matrix(mat_3x3, show_cell_indices = FALSE)
#'
#' # Highlight a row
#' mat_2x2 = matrix(c(1, 2, 3, 4), nrow = 2)
Expand All @@ -157,6 +157,9 @@ gdraw_matrix <- function(
highlight_color = "lemonchiffon"
) {

# Define a value to avoid using the .data pronoun and incorporate rlang...
highlight = value = NULL

if(!requireNamespace("ggplot2", quietly = TRUE)) {
stop("Please make sure `ggplot2` is installed to use this function.")
}
Expand Down
4 changes: 2 additions & 2 deletions man/draw-matrix.Rd

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

0 comments on commit 10a7cef

Please sign in to comment.