Skip to content

Commit

Permalink
Reorganise /R (#91)
Browse files Browse the repository at this point in the history
* Move code for scale_discrete_quorum()

* Remove empty files in /R
  • Loading branch information
judith-bourque authored Apr 6, 2023
1 parent d80a358 commit 4d5c231
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 60 deletions.
5 changes: 0 additions & 5 deletions R/agoraplus.R

This file was deleted.

5 changes: 0 additions & 5 deletions R/civimetre.R

This file was deleted.

5 changes: 0 additions & 5 deletions R/radarplus.R

This file was deleted.

44 changes: 0 additions & 44 deletions R/scale.R

This file was deleted.

46 changes: 46 additions & 0 deletions R/visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,49 @@ theme_clean_dark <- function(base_size = 11,
strip.background = ggplot2::element_blank()
)
}

#' Apply a discrete scale
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' These functions allow you to apply the CLESSN's discrete scales.
#'
#' @inheritParams ggplot2::scale_discrete_manual
#'
#' @author Judith Bourque
#' @examples
#' \dontrun{
#' p <- ggplot2::ggplot(data = ggplot2::mpg) +
#' ggplot2::geom_point(mapping = ggplot2::aes(x = displ, y = cty, colour = class)) +
#' ggplot2::labs(
#' title = "Look at this graph!",
#' subtitle = "What a great look, eh?",
#' caption = "Data: Twitter API \nCLESSN"
#' )
#'
#' p + scale_discrete_quorum(aesthetics = "colour")
#' }
#' @name scale
#' @importFrom ggplot2 scale_discrete_manual
#' @importFrom ggplot2 waiver
NULL
#' @export
#' @rdname scale
scale_discrete_quorum <- function(aesthetics, ..., values, breaks = ggplot2::waiver()) {
ggplot2::scale_discrete_manual(aesthetics,
values = c(
"#FFA562", # orange
"#73F956", # green
"#65DAFF", # light blue
"#FEADFF", # pink
"#FF624D", # red
"#88ADFF", # blue
"#BA8FFF", # purple
"#FEEC20" # yellow
),
breaks,
...
)
}

2 changes: 1 addition & 1 deletion man/scale.Rd

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

0 comments on commit 4d5c231

Please sign in to comment.