our_scale: Create a discrete or continuous scale using our colours

Description Usage Arguments Functions See Also Examples

Description

Create a discrete or continuous scale using our colours

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
our_scale_colour_d(palette = "default", reverse = F, ...)

our_scale_color_d(palette = "default", reverse = F, ...)

our_scale_colour_c(palette = "default", reverse = F, ...)

our_scale_color_c(palette = "default", reverse = F, ...)

our_scale_fill_d(palette = "default", reverse = F, ...)

our_scale_fill_c(palette = "default", reverse = F, ...)

Arguments

palette

Character name of palette in our_palettes_raw

reverse

Boolean indicating whether the palette should be reversed

...

Additional arguments passed to the scale constructor

Functions

See Also

Other access our colours: our_colours, our_palettes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  library(ggplot2)
  
  # Discrete Colour scale
  ggplot(mtcars) + 
    geom_point(aes(x = mpg, 
                   y = wt, 
                   color = as.character(carb))) + 
    our_scale_color_d('default')

  # Continuous Colour Scale
  ggplot(mtcars) + 
    geom_point(aes(x = mpg, 
                   y = wt, 
                   color = wt)) + 
    our_scale_color_c('default')
    
  # Discrete Fill Scale
  ggplot(mtcars) + 
    geom_col(aes(x = reorder(rownames(mtcars), mpg), 
                 y = mpg, 
                 fill = as.character(carb))) +
    coord_flip() +             
    our_scale_fill_d('default') +
    facet_wrap(~as.character(carb), scales='free_y')
    
  # Continuous fill scale  
  ggplot(mtcars) + 
    geom_col(aes(x = reorder(rownames(mtcars), mpg), 
                 y = mpg, 
                 fill = mpg)) +
    coord_flip() +             
    our_scale_fill_c('default')

PeterGrahamJersey/mybizR-style documentation built on July 7, 2019, 2:19 p.m.