diff --git a/R/cycle.R b/R/cycle.R index 077be0c..857d044 100644 --- a/R/cycle.R +++ b/R/cycle.R @@ -1,7 +1,13 @@ -#' Cycle +#' Create a 2 by 2 grid pattern of rotated pictures #' -#' @param p A grob -#' @return A grob +#' `cycle` returns a 2 by 2 grid pattern of four pictures, each obtained from +#' the input `grid::grob` picture `p`. In the top left position of the grid +#' is `p`, in the bottom-right position is the picture `p` rotated by 90 degrees. +#' In the bottom-left position `p` is rotated through 180 degrees and in the +#' top-right position `p` is rotated through 270 degrees. +#' +#' @param p A `grid::grob` for the top-left position +#' @return A `grid::grob` made up of rotations of the four input pictures arranged in a 2 by 2 grid pattern. #' @export cycle <- function(p) { return(quartet(p, rot(rot(rot(p))), rot(p), rot(rot(p)))) diff --git a/R/rot.R b/R/rot.R index f57f1db..f8cd924 100644 --- a/R/rot.R +++ b/R/rot.R @@ -1,8 +1,8 @@ #' Rotate a picture #' #' `rot` returns a new picture, made by rotating the input picture. If no angle -#' is specified then the new picture will be rotated 90 degrees. A different -#' angle can be specified with the `angle` argument. +#' is specified then the new picture will be rotated clockwise by 90 degrees. A +#' different angle can be specified with the `angle` argument. #' #' @param g A `grid::grob` picture #' @param angle An angle diff --git a/man/cycle.Rd b/man/cycle.Rd index 35f3bec..fd7b97f 100644 --- a/man/cycle.Rd +++ b/man/cycle.Rd @@ -2,16 +2,20 @@ % Please edit documentation in R/cycle.R \name{cycle} \alias{cycle} -\title{Cycle} +\title{Create a 2 by 2 grid pattern of rotated pictures} \usage{ cycle(p) } \arguments{ -\item{p}{A picture} +\item{p}{A `grid::grob` for the top-left position} } \value{ -A picture +A `grid::grob` made up of rotations of the four input pictures arranged in a 2 by 2 grid pattern. } \description{ -Cycle +`cycle` returns a 2 by 2 grid pattern of four pictures, each obtained from +the input `grid::grob` picture `p`. In the top left position of the grid +is `p`, in the bottom-right position is the picture `p` rotated by 90 degrees. +In the bottom-left position `p` is rotated through 180 degrees and in the +top-right position `p` is rotated through 270 degrees. } diff --git a/man/rot.Rd b/man/rot.Rd index ce6d603..6ffa6de 100644 --- a/man/rot.Rd +++ b/man/rot.Rd @@ -16,6 +16,6 @@ A rotated `grid::grob` picture } \description{ `rot` returns a new picture, made by rotating the input picture. If no angle -is specified then the new picture will be rotated 90 degrees. A different -angle can be specified with the `angle` argument. +is specified then the new picture will be rotated clockwise by 90 degrees. A +different angle can be specified with the `angle` argument. }