From 17576265879920c58f4b99bfcdef275e49395aca Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Thu, 28 Mar 2024 09:52:42 +0000 Subject: [PATCH] Improve docs for the above function. --- R/above.R | 13 +++++++++---- man/above.Rd | 13 ++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/R/above.R b/R/above.R index dfbf0f7..4456ca2 100644 --- a/R/above.R +++ b/R/above.R @@ -1,10 +1,15 @@ -#' Superimpose two grobs, one above the other. +#' Superimpose two pictures, one above the other. #' -#' @param p A grob -#' @param q Another grob +#' `above` returns a new picture made by placing the first input picture +#' above the second input picture. The user can also provide arguments `m` +#' and `n` in which case the pictures will be placed so that they occupy the +#' output picture in a m:n ratio. +#' +#' @param p A `grid::grob` picture +#' @param q Another `grid::grob` picture #' @param m An integer #' @param n Another integer -#' @return A new grob obtained by superimposing p and q, one above the other. +#' @return A new `grid::grob` picture obtained by superimposing p and q, one above the other. #' @export above <- function(p, q, m = 1, n = 1) { fg <- grid::frameGrob(layout = grid::grid.layout(2, 1)) diff --git a/man/above.Rd b/man/above.Rd index 10386c1..b287239 100644 --- a/man/above.Rd +++ b/man/above.Rd @@ -2,22 +2,25 @@ % Please edit documentation in R/above.R \name{above} \alias{above} -\title{Superimpose two grobs, one above the other.} +\title{Superimpose two pictures, one above the other.} \usage{ above(p, q, m = 1, n = 1) } \arguments{ -\item{p}{A grob} +\item{p}{A `grid::grob` picture} -\item{q}{Another grob} +\item{q}{Another `grid::grob` picture} \item{m}{An integer} \item{n}{Another integer} } \value{ -A new grob obtained by superimposing p and q, one above the other. +A new `grid::grob` picture obtained by superimposing p and q, one above the other. } \description{ -Superimpose two grobs, one above the other. +`above` returns a new picture made by placing the first input picture +above the second input picture. The user can also provide arguments `m` +and `n` in which case the pictures will be placed so that they occupy the +output picture in a m:n ratio. }