From a432a368669b88162486408a6df75aa0c6496712 Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Fri, 29 Mar 2024 09:18:59 +0000 Subject: [PATCH] Improve docs for the quartet function. (#44) --- R/quartet.R | 17 +++++++++++------ man/quartet.Rd | 17 ++++++++++------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/R/quartet.R b/R/quartet.R index ea91e47..0b0fb0f 100644 --- a/R/quartet.R +++ b/R/quartet.R @@ -1,10 +1,15 @@ -#' Quartet +#' Create a 2 by 2 grid pattern of pictures #' -#' @param p A grob -#' @param q Another grob -#' @param r Yet another grob -#' @param s The last grob -#' @return A grob +#' `quartet` returns a 2 by 2 grid pattern made up of the four input `grid::grob` +#' pictures: `p`, `q`, `r` and `s`. In the final grid `p` is in the top-left +#' position, `q` is in the top-right position, `r` is in the bottom-left +#' position and `s` is in the top-right position. +#' +#' @param p A `grid::grob` for the top-left position +#' @param q A `grid::grob` for the top-right position +#' @param r A `grid::grob` for the bottom-left position +#' @param s A `grid::grob` for the bottom-right position +#' @return A `grid::grob` made up of the four input pictures arranged in a 2 by 2 grid pattern. #' @export quartet <- function(p, q, r, s) { return(above(beside(p, q), beside(r, s))) diff --git a/man/quartet.Rd b/man/quartet.Rd index 020bbd4..16efd41 100644 --- a/man/quartet.Rd +++ b/man/quartet.Rd @@ -2,22 +2,25 @@ % Please edit documentation in R/quartet.R \name{quartet} \alias{quartet} -\title{Quartet} +\title{Create a 2 by 2 grid pattern of pictures} \usage{ quartet(p, q, r, s) } \arguments{ -\item{p}{A picture} +\item{p}{A `grid::grob` for the top-left position} -\item{q}{Another picture} +\item{q}{A `grid::grob` for the top-right position} -\item{r}{Yet another picture} +\item{r}{A `grid::grob` for the bottom-left position} -\item{s}{The last picture} +\item{s}{A `grid::grob` for the bottom-right position} } \value{ -A grob +A `grid::grob` made up of the four input pictures arranged in a 2 by 2 grid pattern. } \description{ -Quartet +`quartet` returns a 2 by 2 grid pattern made up of the four input `grid::grob` +pictures: `p`, `q`, `r` and `s`. In the final grid `p` is in the top-left +position, `q` is in the top-right position, `r` is in the bottom-left +position and `s` is in the top-right position. }