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

Document nonet #45

Merged
merged 1 commit into from
Mar 30, 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
33 changes: 21 additions & 12 deletions R/nonet.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
#' Nonet
#' Create a 3 by 3 grid pattern of pictures
#'
#' @param a A grob
#' @param s Another grob
#' @param d Yet another grob
#' @param f The last grob
#' @param g A grob
#' @param h Another grob
#' @param j Yet another grob
#' @param k The last grob
#' @param l The last grob
#' @return A grob
#' `nonet` returns a 3 by 3 grid pattern made up of the nine input `grid::grob`
#' pictures: `a`, `s`, `d`, `f`, `g`, `h`, `j`, `k`, `l`.
#' In the final grid `a` is in the top-left
#' position, `s` is in the top-middle position, `d` is in the top-right
#' position, `f` is in the middle-left position, `g` is in the centre position,
#' `h` is in the middle-right position, `j` is in the bottom-left position,
#' `k` is in the bottom-middle position and `l` is in the bottom-right position.
#'
#' @param a A `grid::grob` for the top-left position
#' @param s A `grid::grob` for the top-middle position
#' @param d A `grid::grob` for the top-right position
#' @param f A `grid::grob` for the middle-left position
#' @param g A `grid::grob` for the centre position
#' @param h A `grid::grob` for the middle-right position
#' @param j A `grid::grob` for the bottom-left position
#' @param k A `grid::grob` for the bottom-middle position
#' @param l A `grid::grob` for the bottom-right position
#' @return A `grid::grob` made up of the nine input pictures arranged in a 3 by 3 grid pattern.
#' @export
nonet <- function(a, s, d, f, g, h, j, k, l) { C <- beside(f, beside(g, h, m = 1, n = 1), m = 1, n = 2)
nonet <- function(a, s, d, f, g, h, j, k, l) {
C <- beside(f, beside(g, h, m = 1, n = 1), m = 1, n = 2)
D <- beside(j, beside(k, l, m = 1, n = 1), m = 1, n = 2)
B <- above(C, D, m = 1, n = 1)
A <- beside(a, beside(s, d, m = 1, n = 1), m = 1, n = 2)
Expand Down
30 changes: 18 additions & 12 deletions man/nonet.Rd

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