call to library(scales)
This commit is contained in:
parent
326f455def
commit
53a8cfa957
|
@ -280,11 +280,12 @@ ax_plotOptions <- function(ax,
|
||||||
#' ax_colors("#F7D358")
|
#' ax_colors("#F7D358")
|
||||||
#'
|
#'
|
||||||
#'
|
#'
|
||||||
|
#' library(scales)
|
||||||
#' apex(
|
#' apex(
|
||||||
#' data = count(diamonds, cut, color),
|
#' data = count(diamonds, cut, color),
|
||||||
#' mapping = aes(x = cut, y = n, fill = color)
|
#' mapping = aes(x = cut, y = n, fill = color)
|
||||||
#' ) %>%
|
#' ) %>%
|
||||||
#' ax_colors(scales::brewer_pal(palette = "Set2")(7))
|
#' ax_colors(brewer_pal(palette = "Set2")(7))
|
||||||
ax_colors <- function(ax, ...) {
|
ax_colors <- function(ax, ...) {
|
||||||
args <- list(...)
|
args <- list(...)
|
||||||
if (length(args) == 1) {
|
if (length(args) == 1) {
|
||||||
|
|
|
@ -33,9 +33,10 @@ apex(
|
||||||
ax_colors("#F7D358")
|
ax_colors("#F7D358")
|
||||||
|
|
||||||
|
|
||||||
|
library(scales)
|
||||||
apex(
|
apex(
|
||||||
data = count(diamonds, cut, color),
|
data = count(diamonds, cut, color),
|
||||||
mapping = aes(x = cut, y = n, fill = color)
|
mapping = aes(x = cut, y = n, fill = color)
|
||||||
) \%>\%
|
) \%>\%
|
||||||
ax_colors(scales::brewer_pal(palette = "Set2")(7))
|
ax_colors(brewer_pal(palette = "Set2")(7))
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ Data used are from `ggplot2` package, data manipulation will be done with the `d
|
||||||
|
|
||||||
```{r message=FALSE, warning=FALSE}
|
```{r message=FALSE, warning=FALSE}
|
||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
|
library(scales)
|
||||||
library(dplyr)
|
library(dplyr)
|
||||||
library(apexcharter)
|
library(apexcharter)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue