Skip to content

Commit

Permalink
Merge pull request #37 from nanxstats/roxygen2md
Browse files Browse the repository at this point in the history
Convert Rd syntax to Markdown
  • Loading branch information
nanxstats committed May 21, 2024
2 parents 7e30687 + c7bfe46 commit 0e0b28d
Show file tree
Hide file tree
Showing 71 changed files with 590 additions and 587 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ Suggests:
VignetteBuilder: knitr
Encoding: UTF-8
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
27 changes: 12 additions & 15 deletions R/continuous-gsea.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
#' The GSEA GenePattern Color Palettes
#' The GSEA GenePattern color palettes
#'
#' Color palette inspired by the colors used in the
#' heatmaps plotted by GSEA GenePattern.
#'
#' @param palette Palette type.
#' Currently there is one available option: \code{"default"}
#' (continuous palette with 12 base colors).
#' Currently there is one available option: `"default"`
#' (continuous palette with 12 base colors).
#' @param n Number of individual colors to be generated.
#' @param alpha Transparency level, a real number in (0, 1].
#' See \code{alpha} in \code{\link[grDevices]{rgb}} for details.
#' See `alpha` in [grDevices::rgb()] for details.
#' @param reverse Logical. Should the order of the colors be reversed?
#'
#' @export rgb_gsea
#'
#' @importFrom grDevices colorRamp rgb
#' @importFrom scales manual_pal
#'
#' @author Nan Xiao <\email{me@@nanx.me}> |
#' <\href{https://nanx.me}{https://nanx.me}>
#' @author Nan Xiao | \email{me@nanx.me} | <https://nanx.me>
#'
#' @note The 12 base colors used in this palette are derived from the
#' \href{https://modulerepository.genepattern.org/gpModuleRepository/download/prod/module/?file=/HeatMapImage/broad.mit.edu:cancer.software.genepattern.module.analysis/00032/6/HeatMapImage.pdf}{HeatMapImage documentation}.
#' [HeatMapImage documentation](https://modulerepository.genepattern.org/gpModuleRepository/download/prod/module/?file=/HeatMapImage/broad.mit.edu:cancer.software.genepattern.module.analysis/00032/6/HeatMapImage.pdf).
#'
#' @examples
#' library("scales")
Expand All @@ -44,7 +43,7 @@ rgb_gsea <- function(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)
alpha_cols
}

#' The GSEA GenePattern Color Palettes
#' The GSEA GenePattern color palettes
#'
#' Color palette inspired by the colors used in the
#' heatmaps plotted by GSEA GenePattern.
Expand All @@ -55,8 +54,7 @@ rgb_gsea <- function(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)
#'
#' @importFrom scales manual_pal
#'
#' @author Nan Xiao <\email{me@@nanx.me}> |
#' <\href{https://nanx.me}{https://nanx.me}>
#' @author Nan Xiao | \email{me@nanx.me} | <https://nanx.me>
#'
#' @examples
#' library("scales")
Expand All @@ -68,19 +66,18 @@ pal_gsea <- function(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)
manual_pal(unname(alpha_cols))
}

#' The GSEA GenePattern Color Scales
#' The GSEA GenePattern color scales
#'
#' See \code{\link{pal_gsea}} for details.
#' See [pal_gsea()] for details.
#'
#' @inheritParams pal_gsea
#' @param ... additional parameters for \code{\link[ggplot2]{discrete_scale}}
#' @param ... Additional parameters for [ggplot2::discrete_scale()].
#'
#' @export scale_color_gsea
#'
#' @importFrom ggplot2 scale_color_gradientn
#'
#' @author Nan Xiao <\email{me@@nanx.me}> |
#' <\href{https://nanx.me}{https://nanx.me}>
#' @author Nan Xiao | \email{me@nanx.me} | <https://nanx.me>
#'
#' @rdname scale_gsea
#'
Expand Down
79 changes: 38 additions & 41 deletions R/continuous-material.R
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
#' Material Design Color Palettes
#'
#' The Material Design color palettes.
#'
#' @param palette Palette type.
#' There are 19 available options:
#' \itemize{
#' \item \code{"red"}
#' \item \code{"pink"}
#' \item \code{"purple"}
#' \item \code{"deep-purple"}
#' \item \code{"indigo"}
#' \item \code{"blue"}
#' \item \code{"light-blue"}
#' \item \code{"cyan"}
#' \item \code{"teal"}
#' \item \code{"green"}
#' \item \code{"light-green"}
#' \item \code{"lime"}
#' \item \code{"yellow"}
#' \item \code{"amber"}
#' \item \code{"orange"},
#' \item \code{"deep-orange"}
#' \item \code{"brown"}
#' \item \code{"grey"}
#' \item \code{"blue-grey"}}
#' See \href{https://m2.material.io/design/color/the-color-system.html}{Material Design color system}
#' for details.
#' Material Design color palettes
#'
#' The Material Design 2 color palettes.
#'
#' @param palette Palette type. There are 19 available options:
#' - `"red"`
#' - `"pink"`
#' - `"purple"`
#' - `"deep-purple"`
#' - `"indigo"`
#' - `"blue"`
#' - `"light-blue"`
#' - `"cyan"`
#' - `"teal"`
#' - `"green"`
#' - `"light-green"`
#' - `"lime"`
#' - `"yellow"`
#' - `"amber"`
#' - `"orange"`,
#' - `"deep-orange"`
#' - `"brown"`
#' - `"grey"`
#' - `"blue-grey"`
#'
#' For details, see [Material Design color
#' system](https://m2.material.io/design/color/the-color-system.html).
#'
#' @param n Number of individual colors to be generated.
#' @param alpha Transparency level, a real number in (0, 1].
#' See \code{alpha} in \code{\link[grDevices]{rgb}} for details.
#' See `alpha` in [grDevices::rgb()] for details.
#' @param reverse Logical. Should the order of the colors be reversed?
#'
#' @export rgb_material
#'
#' @importFrom grDevices colorRamp rgb
#' @importFrom scales manual_pal
#'
#' @author Nan Xiao <\email{me@@nanx.me}> |
#' <\href{https://nanx.me}{https://nanx.me}>
#' @author Nan Xiao | \email{me@nanx.me} | <https://nanx.me>
#'
#' @references
#' \url{https://m2.material.io/design/color/the-color-system.html}
#' <https://m2.material.io/design/color/the-color-system.html>
#'
#' @examples
#' library("scales")
Expand Down Expand Up @@ -69,18 +68,17 @@ rgb_material <- function(
alpha_cols
}

#' Material Design Color Palettes
#' Material Design color palettes
#'
#' The Material Design color palettes.
#' The Material Design 2 color palettes.
#'
#' @inheritParams rgb_material
#'
#' @export pal_material
#'
#' @importFrom scales manual_pal
#'
#' @author Nan Xiao <\email{me@@nanx.me}> |
#' <\href{https://nanx.me}{https://nanx.me}>
#' @author Nan Xiao | \email{me@nanx.me} | <https://nanx.me>
#'
#' @examples
#' library("scales")
Expand All @@ -98,19 +96,18 @@ pal_material <- function(
manual_pal(unname(alpha_cols))
}

#' Material Design Color Palettes
#' Material Design color palettes
#'
#' See \code{\link{pal_material}} for details.
#' See [pal_material()] for details.
#'
#' @inheritParams pal_material
#' @param ... additional parameters for \code{\link[ggplot2]{discrete_scale}}
#' @param ... Additional parameters for [ggplot2::discrete_scale()].
#'
#' @export scale_color_material
#'
#' @importFrom ggplot2 scale_color_gradientn
#'
#' @author Nan Xiao <\email{me@@nanx.me}> |
#' <\href{https://nanx.me}{https://nanx.me}>
#' @author Nan Xiao | \email{me@nanx.me} | <https://nanx.me>
#'
#' @rdname scale_material
#'
Expand Down
22 changes: 10 additions & 12 deletions R/discrete-aaas.R
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#' AAAS Journal Color Palettes
#' AAAS journal color palettes
#'
#' Color palettes inspired by plots in journals published by
#' American Association for the Advancement of Science (AAAS),
#' such as \emph{Science} and \emph{Science Translational Medicine}.
#' such as _Science_ and _Science Translational Medicine_.
#'
#' @param palette Palette type.
#' Currently there is one available option: \code{"default"}
#' (10-color palette inspired by \emph{Science}).
#' Currently there is one available option: `"default"`
#' (10-color palette inspired by _Science_).
#' @param alpha Transparency level, a real number in (0, 1].
#' See \code{alpha} in \code{\link[grDevices]{rgb}} for details.
#' See `alpha` in [grDevices::rgb()] for details.
#'
#' @export pal_aaas
#'
#' @importFrom grDevices col2rgb rgb
#' @importFrom scales manual_pal
#'
#' @author Nan Xiao <\email{me@@nanx.me}> |
#' <\href{https://nanx.me}{https://nanx.me}>
#' @author Nan Xiao | \email{me@nanx.me} | <https://nanx.me>
#'
#' @examples
#' library("scales")
Expand All @@ -38,19 +37,18 @@ pal_aaas <- function(palette = c("default"), alpha = 1) {
manual_pal(unname(alpha_cols))
}

#' AAAS Journal Color Scales
#' AAAS journal color scales
#'
#' See \code{\link{pal_aaas}} for details.
#' See [pal_aaas()] for details.
#'
#' @inheritParams pal_aaas
#' @param ... additional parameters for \code{\link[ggplot2]{discrete_scale}}
#' @param ... Additional parameters for [ggplot2::discrete_scale()].
#'
#' @export scale_color_aaas
#'
#' @importFrom ggplot2 discrete_scale
#'
#' @author Nan Xiao <\email{me@@nanx.me}> |
#' <\href{https://nanx.me}{https://nanx.me}>
#' @author Nan Xiao | \email{me@nanx.me} | <https://nanx.me>
#'
#' @rdname scale_aaas
#'
Expand Down
24 changes: 15 additions & 9 deletions R/discrete-bmj.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#' BMJ Color Palettes
#' BMJ color palettes
#'
#' Color palette from the BMJ living style guide.
#'
#' @param palette Palette type.
#' Currently there is one available option: \code{"default"}
#' (9-color palette).
#' Currently there is one available option: `"default"`
#' (9-color palette).
#' @param alpha Transparency level, a real number in (0, 1].
#' See \code{alpha} in \code{\link[grDevices]{rgb}} for details.
#' See `alpha` in [grDevices::rgb()] for details.
#'
#' @export pal_bmj
#'
#' @importFrom grDevices col2rgb rgb
#' @importFrom scales manual_pal
#'
#' @author Hui Chen <\email{huichen@@zju.edu.cn}>
#' @author Hui Chen | \email{huichen@zju.edu.cn}
#'
#' @references
#' <https://technology.bmj.com/living-style-guide/colour.html>
#'
#' @examples
#' library("scales")
Expand All @@ -35,21 +38,24 @@ pal_bmj <- function(palette = c("default"), alpha = 1) {
manual_pal(unname(alpha_cols))
}

#' BMJ Color Scales
#' BMJ color scales
#'
#' See \code{\link{pal_bmj}} for details.
#' See [pal_bmj()] for details.
#'
#' @inheritParams pal_bmj
#' @param ... additional parameters for \code{\link[ggplot2]{discrete_scale}}
#' @param ... Additional parameters for [ggplot2::discrete_scale()].
#'
#' @export scale_color_bmj
#'
#' @importFrom ggplot2 discrete_scale
#'
#' @author Hui Chen <\email{huichen@@zju.edu.cn}>
#' @author Hui Chen | \email{huichen@zju.edu.cn}
#'
#' @rdname scale_bmj
#'
#' @references
#' <https://technology.bmj.com/living-style-guide/colour.html>
#'
#' @examples
#' library("ggplot2")
#' data("diamonds")
Expand Down
31 changes: 16 additions & 15 deletions R/discrete-cosmic.R
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
#' COSMIC Color Palettes
#' COSMIC color palettes
#'
#' Color palettes inspired by the colors used in projects from the
#' \href{https://cancer.sanger.ac.uk/cosmic}{Catalogue Of
#' Somatic Mutations in Cancers (COSMIC)}
#' [Catalogue Of
#' Somatic Mutations in Cancers (COSMIC)](https://cancer.sanger.ac.uk/cosmic).
#'
#' @param palette Palette type. Currently there are three available options:
#' \code{"signature_substitutions"} (6-color palette),
#' \code{"hallmarks_light"} (10-color palette), and \code{"hallmarks_dark"}
#' (10-color palette). The \code{"hallmarks_light"} option is from
#' \href{https://pubmed.ncbi.nlm.nih.gov/21376230/}{Hanahan and Weinberg (2011)}.
#' - `"signature_substitutions"` (6-color palette).
#' - `"hallmarks_light"` (10-color palette).
#' - `"hallmarks_dark"` (10-color palette).
#'
#' The `"hallmarks_light"` option is from
#' [Hanahan and Weinberg (2011)](https://pubmed.ncbi.nlm.nih.gov/21376230/).
#' @param alpha Transparency level, a real number in (0, 1].
#' See \code{alpha} in \code{\link[grDevices]{rgb}} for details.
#' See `alpha` in [grDevices::rgb()] for details.
#'
#' @export pal_cosmic
#'
#' @importFrom grDevices col2rgb rgb
#' @importFrom scales manual_pal
#'
#' @author Joshua H. Cook <\email{joshuacook0023@@gmail.com}> |
#' <\href{https://github.com/jhrcook}{GitHub/jhrcook}>
#' @author Joshua H. Cook | \email{joshuacook0023@gmail.com} |
#' [@jhrcook](https://github.com/jhrcook)
#'
#' @examples
#' library("scales")
Expand Down Expand Up @@ -47,19 +48,19 @@ pal_cosmic <- function(
manual_pal(unname(alpha_cols))
}

#' COSMIC Color Scales
#' COSMIC color scales
#'
#' See \code{\link{pal_cosmic}} for details.
#' See [pal_cosmic()] for details.
#'
#' @inheritParams pal_cosmic
#' @param ... additional parameters for \code{\link[ggplot2]{discrete_scale}}
#' @param ... Additional parameters for [ggplot2::discrete_scale()].
#'
#' @export scale_color_cosmic
#'
#' @importFrom ggplot2 discrete_scale
#'
#' @author Joshua H. Cook <\email{joshuacook0023@@gmail.com}> |
#' <\href{https://github.com/jhrcook}{GitHub/jhrcook}>
#' @author Joshua H. Cook | \email{joshuacook0023@gmail.com} |
#' [@jhrcook](https://github.com/jhrcook)
#'
#' @rdname scale_cosmic
#'
Expand Down
Loading

0 comments on commit 0e0b28d

Please sign in to comment.