Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document cycle #46

Merged
merged 2 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions R/cycle.R
Original file line number Diff line number Diff line change
@@ -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))))
Expand Down
4 changes: 2 additions & 2 deletions R/rot.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 8 additions & 4 deletions man/cycle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/rot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.