From 25102e60b04a8ead91a0abd93e7859fef3518226 Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Mon, 11 Mar 2024 11:10:48 +0000 Subject: [PATCH 1/5] Fix generic function signatures so they match. --- R/above-grob.R | 1 + R/above.R | 7 +++++-- R/beside-grob.R | 5 ++++- R/beside.R | 10 +++++++--- R/cycle.R | 4 ++-- R/flip.R | 2 +- R/rot-grob.R | 1 + R/rot.R | 3 ++- 8 files changed, 23 insertions(+), 10 deletions(-) diff --git a/R/above-grob.R b/R/above-grob.R index f148baf..964e259 100644 --- a/R/above-grob.R +++ b/R/above-grob.R @@ -1,5 +1,6 @@ #' Superimpose two grobs, one above the other. #' +#' @param p A grob #' @param q Another grob #' @param m An integer #' @param n Another integer diff --git a/R/above.R b/R/above.R index 6cfa008..af93c09 100644 --- a/R/above.R +++ b/R/above.R @@ -1,8 +1,11 @@ #' Superimpose two pictures, one above the other. #' #' @param p A picture +#' @param q Another picture +#' @param m An integer +#' @param n Another integer #' @return A picture #' @export -above <- function(picture, ...) { - UseMethod("above", picture) +above <- function(p, q, m, n) { + UseMethod("above") } diff --git a/R/beside-grob.R b/R/beside-grob.R index 4e05883..c7c9834 100644 --- a/R/beside-grob.R +++ b/R/beside-grob.R @@ -1,6 +1,9 @@ #' Superimpose two grobs side-by-side. #' -#' @param g grob +#' @param p grob +#' @param q grob +#' @param m An integer +#' @param n Another integer #' @return A grob #' @export beside.grob <- function(p, q, m = 1, n = 1) { diff --git a/R/beside.R b/R/beside.R index eefe11d..ee5f837 100644 --- a/R/beside.R +++ b/R/beside.R @@ -1,8 +1,12 @@ #' Superimpose two grobs, side-by-side. #' -#' @param p A picture +#' @param p grob +#' @param q grob +#' @param m An integer +#' @param n Another integer +#' @return A grob #' @return A picture #' @export -beside <- function(picture, ...) { - UseMethod("beside", picture) +beside <- function(p, q, m = 1, n = 1) { + UseMethod("beside", p) } diff --git a/R/cycle.R b/R/cycle.R index 3182dda..ce44549 100644 --- a/R/cycle.R +++ b/R/cycle.R @@ -1,7 +1,7 @@ #' Cycle #' -#' @param g grob -#' @return A grob +#' @param p A picture +#' @return A picture #' @export cycle <- function(p) { return(quartet(p, rot(rot(rot(p))), rot(p), rot(rot(p)))) diff --git a/R/flip.R b/R/flip.R index 885334d..eed68ff 100644 --- a/R/flip.R +++ b/R/flip.R @@ -3,6 +3,6 @@ #' @param picture A picture #' @return Flipped picture #' @export -flip <- function(picture, ...) { +flip <- function(picture) { UseMethod("flip", picture) } diff --git a/R/rot-grob.R b/R/rot-grob.R index 19c4767..97a84b3 100644 --- a/R/rot-grob.R +++ b/R/rot-grob.R @@ -1,6 +1,7 @@ #' Rotate a grob. #' #' @param g A grob +#' @param angle An angle #' @return Rotated grob #' @export rot.grob <- function(g, angle = 90) { diff --git a/R/rot.R b/R/rot.R index 067edca..270138c 100644 --- a/R/rot.R +++ b/R/rot.R @@ -1,8 +1,9 @@ #' Rotate a picture. #' #' @param picture A picture +#' @param angle An angle #' @return Rotated picture #' @export -rot <- function(picture, ...) { +rot <- function(picture, angle) { UseMethod("rot", picture) } From d45bcf60066ef9c7df12e8e40d3691d7843396c6 Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Mon, 11 Mar 2024 11:26:00 +0000 Subject: [PATCH 2/5] Fix a couple more function signatures. --- R/flip.R | 4 ++-- R/plot-picture.R | 4 ++-- R/rot.R | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/flip.R b/R/flip.R index eed68ff..f611f63 100644 --- a/R/flip.R +++ b/R/flip.R @@ -3,6 +3,6 @@ #' @param picture A picture #' @return Flipped picture #' @export -flip <- function(picture) { - UseMethod("flip", picture) +flip <- function(g) { + UseMethod("flip", g) } diff --git a/R/plot-picture.R b/R/plot-picture.R index a02e3c2..8239114 100644 --- a/R/plot-picture.R +++ b/R/plot-picture.R @@ -3,6 +3,6 @@ #' @param picture A picture #' @return grid.draw(picture) #' @export -plot.picture <- function(picture) { - grid::grid.draw(picture) +plot.picture <- function(x, ...) { + grid::grid.draw(x) } diff --git a/R/rot.R b/R/rot.R index 270138c..8a231a4 100644 --- a/R/rot.R +++ b/R/rot.R @@ -4,6 +4,6 @@ #' @param angle An angle #' @return Rotated picture #' @export -rot <- function(picture, angle) { - UseMethod("rot", picture) +rot <- function(g, angle) { + UseMethod("rot", g) } From 30b5bd9f4c644d3725ce020eea3f17064769ba31 Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Mon, 11 Mar 2024 11:26:12 +0000 Subject: [PATCH 3/5] Update docs. --- DESCRIPTION | 2 +- man/above.Rd | 9 +++++++-- man/above.grob.Rd | 3 ++- man/beside.Rd | 13 ++++++++++--- man/beside.grob.Rd | 9 +++++++-- man/cycle.Rd | 5 ++--- man/flip.Rd | 3 +-- man/flip.grob.Rd | 1 - man/nonet.Rd | 1 - man/plot.picture.Rd | 3 +-- man/quartet.Rd | 1 - man/rot.Rd | 5 +++-- man/rot.grob.Rd | 3 ++- 13 files changed, 36 insertions(+), 22 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f6a61a8..1a8e12a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,6 +8,6 @@ Description: Peter Henderson's Functional Geometry in R. License: MIT + file LICENSE Imports: grid -RoxygenNote: 5.0.1 +RoxygenNote: 7.2.3 URL: https://github.com/mhenderson/funcgeo BugReports: https://github.com/mhenderson/funcgeo/issues diff --git a/man/above.Rd b/man/above.Rd index dec9cb6..7156132 100644 --- a/man/above.Rd +++ b/man/above.Rd @@ -4,10 +4,16 @@ \alias{above} \title{Superimpose two pictures, one above the other.} \usage{ -above(picture, ...) +above(p, q, m, n) } \arguments{ \item{p}{A picture} + +\item{q}{Another picture} + +\item{m}{An integer} + +\item{n}{Another integer} } \value{ A picture @@ -15,4 +21,3 @@ A picture \description{ Superimpose two pictures, one above the other. } - diff --git a/man/above.grob.Rd b/man/above.grob.Rd index 10ec5c8..19ed06f 100644 --- a/man/above.grob.Rd +++ b/man/above.grob.Rd @@ -7,6 +7,8 @@ \method{above}{grob}(p, q, m = 1, n = 1) } \arguments{ +\item{p}{A grob} + \item{q}{Another grob} \item{m}{An integer} @@ -19,4 +21,3 @@ A new grob obtained by superimposing p and q, one above the other. \description{ Superimpose two grobs, one above the other. } - diff --git a/man/beside.Rd b/man/beside.Rd index d39d936..e963a18 100644 --- a/man/beside.Rd +++ b/man/beside.Rd @@ -4,15 +4,22 @@ \alias{beside} \title{Superimpose two grobs, side-by-side.} \usage{ -beside(picture, ...) +beside(p, q, m = 1, n = 1) } \arguments{ -\item{p}{A picture} +\item{p}{grob} + +\item{q}{grob} + +\item{m}{An integer} + +\item{n}{Another integer} } \value{ +A grob + A picture } \description{ Superimpose two grobs, side-by-side. } - diff --git a/man/beside.grob.Rd b/man/beside.grob.Rd index ca6e8ea..4007704 100644 --- a/man/beside.grob.Rd +++ b/man/beside.grob.Rd @@ -7,7 +7,13 @@ \method{beside}{grob}(p, q, m = 1, n = 1) } \arguments{ -\item{g}{grob} +\item{p}{grob} + +\item{q}{grob} + +\item{m}{An integer} + +\item{n}{Another integer} } \value{ A grob @@ -15,4 +21,3 @@ A grob \description{ Superimpose two grobs side-by-side. } - diff --git a/man/cycle.Rd b/man/cycle.Rd index 283d9cc..35f3bec 100644 --- a/man/cycle.Rd +++ b/man/cycle.Rd @@ -7,12 +7,11 @@ cycle(p) } \arguments{ -\item{g}{grob} +\item{p}{A picture} } \value{ -A grob +A picture } \description{ Cycle } - diff --git a/man/flip.Rd b/man/flip.Rd index 05ab865..ac00e9f 100644 --- a/man/flip.Rd +++ b/man/flip.Rd @@ -4,7 +4,7 @@ \alias{flip} \title{Flip a picture.} \usage{ -flip(picture, ...) +flip(g) } \arguments{ \item{picture}{A picture} @@ -15,4 +15,3 @@ Flipped picture \description{ Flip a picture. } - diff --git a/man/flip.grob.Rd b/man/flip.grob.Rd index b6bb4ae..20df25a 100644 --- a/man/flip.grob.Rd +++ b/man/flip.grob.Rd @@ -15,4 +15,3 @@ Flipped grob \description{ Flip a grob. } - diff --git a/man/nonet.Rd b/man/nonet.Rd index 21a68e6..1919a48 100644 --- a/man/nonet.Rd +++ b/man/nonet.Rd @@ -31,4 +31,3 @@ A grob \description{ Nonet } - diff --git a/man/plot.picture.Rd b/man/plot.picture.Rd index 0326f3b..88bf7af 100644 --- a/man/plot.picture.Rd +++ b/man/plot.picture.Rd @@ -4,7 +4,7 @@ \alias{plot.picture} \title{plot.picture} \usage{ -\method{plot}{picture}(picture) +\method{plot}{picture}(x, ...) } \arguments{ \item{picture}{A picture} @@ -15,4 +15,3 @@ grid.draw(picture) \description{ plot.picture } - diff --git a/man/quartet.Rd b/man/quartet.Rd index 56b51bf..020bbd4 100644 --- a/man/quartet.Rd +++ b/man/quartet.Rd @@ -21,4 +21,3 @@ A grob \description{ Quartet } - diff --git a/man/rot.Rd b/man/rot.Rd index cb9a5a8..378a2e4 100644 --- a/man/rot.Rd +++ b/man/rot.Rd @@ -4,9 +4,11 @@ \alias{rot} \title{Rotate a picture.} \usage{ -rot(picture, ...) +rot(g, angle) } \arguments{ +\item{angle}{An angle} + \item{picture}{A picture} } \value{ @@ -15,4 +17,3 @@ Rotated picture \description{ Rotate a picture. } - diff --git a/man/rot.grob.Rd b/man/rot.grob.Rd index d4e15f2..557fe4b 100644 --- a/man/rot.grob.Rd +++ b/man/rot.grob.Rd @@ -8,6 +8,8 @@ } \arguments{ \item{g}{A grob} + +\item{angle}{An angle} } \value{ Rotated grob @@ -15,4 +17,3 @@ Rotated grob \description{ Rotate a grob. } - From 70fd517912240854c405696a18eef352f036d46a Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Mon, 11 Mar 2024 11:30:08 +0000 Subject: [PATCH 4/5] A few small documentation corrections. --- R/flip.R | 2 +- R/plot-picture.R | 2 +- R/rot.R | 2 +- man/flip.Rd | 2 +- man/plot.picture.Rd | 2 +- man/rot.Rd | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/R/flip.R b/R/flip.R index f611f63..2069526 100644 --- a/R/flip.R +++ b/R/flip.R @@ -1,6 +1,6 @@ #' Flip a picture. #' -#' @param picture A picture +#' @param g A picture #' @return Flipped picture #' @export flip <- function(g) { diff --git a/R/plot-picture.R b/R/plot-picture.R index 8239114..52ec806 100644 --- a/R/plot-picture.R +++ b/R/plot-picture.R @@ -1,6 +1,6 @@ #' plot.picture #' -#' @param picture A picture +#' @param x A picture #' @return grid.draw(picture) #' @export plot.picture <- function(x, ...) { diff --git a/R/rot.R b/R/rot.R index 8a231a4..efe7da8 100644 --- a/R/rot.R +++ b/R/rot.R @@ -1,6 +1,6 @@ #' Rotate a picture. #' -#' @param picture A picture +#' @param g A picture #' @param angle An angle #' @return Rotated picture #' @export diff --git a/man/flip.Rd b/man/flip.Rd index ac00e9f..8d36393 100644 --- a/man/flip.Rd +++ b/man/flip.Rd @@ -7,7 +7,7 @@ flip(g) } \arguments{ -\item{picture}{A picture} +\item{g}{A picture} } \value{ Flipped picture diff --git a/man/plot.picture.Rd b/man/plot.picture.Rd index 88bf7af..f54ab2b 100644 --- a/man/plot.picture.Rd +++ b/man/plot.picture.Rd @@ -7,7 +7,7 @@ \method{plot}{picture}(x, ...) } \arguments{ -\item{picture}{A picture} +\item{x}{A picture} } \value{ grid.draw(picture) diff --git a/man/rot.Rd b/man/rot.Rd index 378a2e4..1d3b486 100644 --- a/man/rot.Rd +++ b/man/rot.Rd @@ -7,9 +7,9 @@ rot(g, angle) } \arguments{ -\item{angle}{An angle} +\item{g}{A picture} -\item{picture}{A picture} +\item{angle}{An angle} } \value{ Rotated picture From fd0d3ff0fef76b5c6739af571afe64b6595e57c2 Mon Sep 17 00:00:00 2001 From: Matthew Henderson Date: Mon, 11 Mar 2024 11:35:15 +0000 Subject: [PATCH 5/5] Another documentation fix. --- R/plot-picture.R | 1 + man/plot.picture.Rd | 2 ++ 2 files changed, 3 insertions(+) diff --git a/R/plot-picture.R b/R/plot-picture.R index 52ec806..e1e4b23 100644 --- a/R/plot-picture.R +++ b/R/plot-picture.R @@ -1,6 +1,7 @@ #' plot.picture #' #' @param x A picture +#' @param ... Anything else. #' @return grid.draw(picture) #' @export plot.picture <- function(x, ...) { diff --git a/man/plot.picture.Rd b/man/plot.picture.Rd index f54ab2b..85d45db 100644 --- a/man/plot.picture.Rd +++ b/man/plot.picture.Rd @@ -8,6 +8,8 @@ } \arguments{ \item{x}{A picture} + +\item{...}{Anything else.} } \value{ grid.draw(picture)