Skip to content

Commit

Permalink
return value and examples for theme_pcp
Browse files Browse the repository at this point in the history
  • Loading branch information
heike committed Nov 25, 2022
1 parent 9a1786a commit fecfca9
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.2.0
Date: 2022-11-25 16:11:42 UTC
SHA: 9a1786a98508575c3747f01c6abf4a44b6e66ad5
23 changes: 18 additions & 5 deletions R/theme_pcp.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
#' Theme for parallel coordinate plots
#'
#' The function `theme_pcp` provides a wrapper for thematic
#' choices suitable for parallel coordinate axes. In particular,
#' axes labeling in parallel coordinate plot is quite un-informative,
#' as they are based by default on variable names derived during the
#' choices suitable for parallel coordinate plots. In particular,
#' the labeling of axes in parallel coordinate plot is quite un-informative.
#' In the default theme axes labels are based on variable names derived during the
#' data wrangling step.
#'
#' @inheritParams ggplot2::theme_bw
#' @export
#' @importFrom ggplot2 %+replace%
#' @return A `ggplot2` theme object based on [ggplot2::theme_bw()] without y axis and x axes labels.
#' @seealso [ggplot2::theme_bw()]
#' @examples
#' library(ggplot2)
#' gg <- iris |>
#' pcp_select(tidyselect::everything()) |>
#' pcp_scale() |>
#' pcp_arrange() |>
#' ggplot(aes_pcp(colour = Species)) +
#' geom_pcp()
#'
theme_pcp <- function(base_size = 9, base_family = "") {
#' # plot with the default ggplot2 theme
#' gg
#' # better:
#' gg + theme_pcp()
theme_pcp <- function(base_size = 11, base_family = "") {
theme_bw(base_size = base_size, base_family = base_family) %+replace%
theme(axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
Expand Down
28 changes: 24 additions & 4 deletions man/theme_pcp.Rd

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

0 comments on commit fecfca9

Please sign in to comment.