From af3e28edc73df267d5e3a6c48ce16c8b58c491f3 Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Fri, 29 Mar 2024 09:02:36 +0000 Subject: [PATCH] Improved docs for the beside function. --- R/beside.R | 13 +++++++++---- man/beside.Rd | 13 ++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/R/beside.R b/R/beside.R index b656ee6..edba46b 100644 --- a/R/beside.R +++ b/R/beside.R @@ -1,10 +1,15 @@ -#' Superimpose two grobs side-by-side. +#' Superimpose two pictures side-by-side. #' -#' @param p grob -#' @param q grob +#' `beside` returns a new picture made by placing the first input picture +#' beside 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 grob +#' @return A new `grid::grob` picture obtained by superimposing p and q, one beside the other. #' @export beside <- function(p, q, m = 1, n = 1) { fg <- grid::frameGrob(layout = grid::grid.layout(1, 2)) diff --git a/man/beside.Rd b/man/beside.Rd index 61832d6..d82752f 100644 --- a/man/beside.Rd +++ b/man/beside.Rd @@ -2,22 +2,25 @@ % Please edit documentation in R/beside.R \name{beside} \alias{beside} -\title{Superimpose two grobs side-by-side.} +\title{Superimpose two pictures side-by-side.} \usage{ beside(p, q, m = 1, n = 1) } \arguments{ -\item{p}{grob} +\item{p}{A `grid::grob` picture} -\item{q}{grob} +\item{q}{Another `grid::grob` picture} \item{m}{An integer} \item{n}{Another integer} } \value{ -A grob +A new `grid::grob` picture obtained by superimposing p and q, one beside the other. } \description{ -Superimpose two grobs side-by-side. +`beside` returns a new picture made by placing the first input picture +beside 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. }