Skip to content

Commit

Permalink
fix Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Jul 23, 2024
1 parent 7965809 commit cff76d5
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
3 changes: 1 addition & 2 deletions R/ggheat.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
#' you can use `mapping` argument to control it. The data in the underlying
#' ggplot object contains following columns:
#'
#' - `.row_panel` or `.column_panl` instead of a column `.panel` since
#' annotation can only have one facet axiss: the row panel
#' - `.row_panel`: the row panel
#'
#' - `.column_panel`: the column panel
#'
Expand Down
29 changes: 29 additions & 0 deletions R/htanno-gg.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@
#' @inheritParams htanno
#' @importFrom ggplot2 aes
#' @inheritParams ggplot2::ggplot
#'
#' @section ggplot2 details:
#' `gganno` is similar to `ggheat` and `ggplot` in that it initializes a
#' `ggplot` data and `mapping`. The data input can be a matrix, a data frame, or
#' a simple vector that will be converted into a one-column matrix, and can
#' inherit from the heatmap matrix.
#'
#' But for ggplot usage, matrix (including a simple vector) data is converted
#' into a long-format data frame, similar to the process utilized in `ggheat`.
#' But note that the long-format data frame does not contain `.row_panel` or
#' `.column_panel` column, as annotations can only have one facet axis. In the
#' case where the input data is already a data frame, three additional
#' columns-`.row_names`, `.row_index`, and `.panel`—are added to the data frame.
#'
#' The data in the underlying ggplot object contains following columns:
#'
#' - `.panel`: the panel for current annotation
#'
#' - `.row_names` and `.row_index`: the row names and row index of the original
#' matrix or data frame.
#'
#' - `.column_names` and `.column_index`: the row and column index of the
#' original matrix (only applicable if `data` is a `matrix`).
#'
#' - `.x` or `.y`: the `x` or `y` coordinates
#'
#' - `value`: the actual matrix value (only applicable if `data` is a
#' `matrix`).
#'
#' @return A `HtannoGG` object.
#' @examples
#' ggheat(matrix(rnorm(81), nrow = 9)) +
Expand Down
3 changes: 1 addition & 2 deletions man/ggheat.Rd

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

27 changes: 27 additions & 0 deletions man/htanno_gg.Rd

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

0 comments on commit cff76d5

Please sign in to comment.