Skip to content

Commit

Permalink
refactor examples
Browse files Browse the repository at this point in the history
Cleanup code from that exported by Rdconv
  • Loading branch information
jrnold committed Mar 14, 2017
1 parent 408ecbc commit 97fae8a
Show file tree
Hide file tree
Showing 94 changed files with 46 additions and 422 deletions.
4 changes: 0 additions & 4 deletions inst/examples/ex-bank_slopes.R
@@ -1,8 +1,4 @@
### Name: bank_slopes
### Title: Bank Slopes to 45 degrees
### Aliases: bank_slopes

### ** Examples

library("ggplot2")
# Use the classic sunspot data from Cleveland's original paper
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-calc_pal.R
@@ -1,8 +1,4 @@
### Name: calc_pal
### Title: Calc color palette (discrete)
### Aliases: calc_pal

### ** Examples

library(scales)
show_col(calc_pal()(12))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-calc_shape_pal.R
@@ -1,8 +1,4 @@
### Name: calc_shape_pal
### Title: Calc shape palette (discrete)
### Aliases: calc_shape_pal

### ** Examples

library("ggplot2")
show_shapes(calc_shape_pal()(15))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-circlefill_shape_pal.R
@@ -1,8 +1,4 @@
### Name: circlefill_shape_pal
### Title: Filled Circle Shape palette (discrete)
### Aliases: circlefill_shape_pal

### ** Examples

library("ggplot2")
(ggplot(mtcars, aes(x=mpg, y=hp, shape=factor(cyl)))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-cleveland_shape_pal.R
@@ -1,9 +1,5 @@
### Name: cleveland_shape_pal
### Title: Shape palette from Cleveland "Elements of Graphing Data"
### (discrete).
### Aliases: cleveland_shape_pal

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) +
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-colorblind.R
@@ -1,9 +1,5 @@
### Name: colorblind_pal
### Title: Colorblind Color Palette (Discrete) and Scales
### Aliases: colorblind_pal scale_colour_colorblind scale_color_colorblind
### scale_fill_colorblind

### ** Examples

library("ggplot2")
library(scales)
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-economist_pal.R
@@ -1,8 +1,4 @@
### Name: economist_pal
### Title: Economist color palette (discrete)
### Aliases: economist_pal

### ** Examples

library(scales)
show_col(economist_pal()(6))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-excel_pal.R
@@ -1,8 +1,4 @@
### Name: excel_pal
### Title: Excel color palette (discrete)
### Aliases: excel_pal

### ** Examples

library("scales")
show_col(excel_pal()(8))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-few_pal.R
@@ -1,9 +1,5 @@
### Name: few_pal
### Title: Color Palletes from Few's "Practical Rules for Using Color in
### Charts"
### Aliases: few_pal

### ** Examples

library("scales")
show_col(few_pal()(7))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-fivethirtyeight_pal.R
@@ -1,8 +1,4 @@
### Name: fivethirtyeight_pal
### Title: fivethirtyeight.com color palette
### Aliases: fivethirtyeight_pal

### ** Examples

library("scales")
show_col(fivethirtyeight_pal()(3))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-gdocs_pal.R
@@ -1,8 +1,4 @@
### Name: gdocs_pal
### Title: Google Docs color palette (discrete)
### Aliases: gdocs_pal

### ** Examples

library("scales")
show_col(gdocs_pal()(20))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-geom_rangeframe.R
@@ -1,9 +1,5 @@
### Name: geom_rangeframe
### Title: Range Frames
### Aliases: geom_rangeframe GeomRangeFrame
### Keywords: datasets

### ** Examples

library("ggplot2")
ggplot(mtcars, aes(wt, mpg)) +
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-geom_tufteboxplot.R
@@ -1,9 +1,5 @@
### Name: geom_tufteboxplot
### Title: Tufte's Box Blot
### Aliases: geom_tufteboxplot GeomTufteboxplot
### Keywords: datasets

### ** Examples

library("ggplot2")
p <- ggplot(mtcars, aes(factor(cyl), mpg))
Expand Down
10 changes: 3 additions & 7 deletions inst/examples/ex-palette_pander.R
@@ -1,12 +1,8 @@
### Name: palette_pander
### Title: Color palette from the pander package
### Aliases: palette_pander

### ** Examples

## Not run:
##D palette_pander(TRUE)
## End(Not run)
\dontrun{
palette_pander(TRUE)
}



4 changes: 0 additions & 4 deletions inst/examples/ex-ptol_pal.R
@@ -1,8 +1,4 @@
### Name: ptol_pal
### Title: Color Palettes from Paul Tol's "Colour Schemes"
### Aliases: ptol_pal

### ** Examples

library("scales")
show_col(ptol_pal()(6))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-scale_color_tableau.R
@@ -1,8 +1,4 @@
### Name: scale_colour_tableau
### Title: Tableau color scales.
### Aliases: scale_colour_tableau scale_fill_tableau scale_color_tableau

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) +
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-scale_colour_gradient2_tableau.R
@@ -1,9 +1,5 @@
### Name: scale_colour_gradient2_tableau
### Title: Tableau diverging colour scales (continuous)
### Aliases: scale_colour_gradient2_tableau scale_fill_gradient2_tableau
### scale_color_gradient2_tableau

### ** Examples

library("ggplot2")
df <- data.frame(
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-scale_colour_gradient_tableau.R
@@ -1,10 +1,6 @@
### Name: scale_colour_gradient_tableau
### Title: Tableau sequential colour scale (continuous)
### Aliases: scale_colour_gradient_tableau scale_fill_gradient_tableau
### scale_color_gradient_tableau scale_color_continuous_tableau
### scale_fill_continuous_tableau

### ** Examples

#'
library("ggplot2")
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-scale_linetype_stata.R
@@ -1,8 +1,4 @@
### Name: scale_linetype_stata
### Title: Stata linetype palette (discrete)
### Aliases: scale_linetype_stata

### ** Examples

library("tidyverse")
rescale01 <- function(x) {(x - min(x)) / diff(range(x))}
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-scale_shape_stata.R
@@ -1,8 +1,4 @@
### Name: scale_shape_stata
### Title: Stata shape scale
### Aliases: scale_shape_stata

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) +
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-scale_shape_tableau.R
@@ -1,8 +1,4 @@
### Name: scale_shape_tableau
### Title: Tableau shape scales
### Aliases: scale_shape_tableau

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) +
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-scale_shape_tremmel.R
@@ -1,8 +1,4 @@
### Name: scale_shape_tremmel
### Title: Shape scales from Tremmel (1995)
### Aliases: scale_shape_tremmel

### ** Examples

library("ggplot2")
(ggplot(mtcars, aes(x=mpg, y=hp, shape=factor(cyl)))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-scale_solarized.R
@@ -1,9 +1,5 @@
### Name: scale_fill_solarized
### Title: Solarized color scales
### Aliases: scale_fill_solarized scale_colour_solarized
### scale_color_solarized

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) +
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-show_linetypes.R
@@ -1,8 +1,4 @@
### Name: show_linetypes
### Title: Show linetypes
### Aliases: show_linetypes

### ** Examples

library("scales")
show_linetypes(linetype_pal()(3))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-show_shapes.R
@@ -1,8 +1,4 @@
### Name: show_shapes
### Title: Show shapes
### Aliases: show_shapes

### ** Examples

library("scales")
show_shapes(shape_pal()(5))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-solarized_pal.R
@@ -1,8 +1,4 @@
### Name: solarized_pal
### Title: Solarized color palette (discrete)
### Aliases: solarized_pal

### ** Examples

library("scales")
show_col(solarized_pal()(2))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-stata_pal.R
@@ -1,8 +1,4 @@
### Name: stata_pal
### Title: Stata color palettes (discrete)
### Aliases: stata_pal

### ** Examples

library("scales")
show_col(stata_pal("s2color")(15))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-tableau_color_pal.R
@@ -1,8 +1,4 @@
### Name: tableau_color_pal
### Title: Color Palettes based on Tableau (discrete)
### Aliases: tableau_color_pal

### ** Examples

library("scales")
show_col(tableau_color_pal('tableau20')(20))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-tableau_div_gradient_pal.R
@@ -1,8 +1,4 @@
### Name: tableau_div_gradient_pal
### Title: Tableau diverging colour gradient palettes (continuous)
### Aliases: tableau_div_gradient_pal

### ** Examples

x <- seq(-1, 1, length = 100)
r <- sqrt(outer(x^2, x^2, '+'))
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-tableau_seq_gradient_pal.R
@@ -1,8 +1,4 @@
### Name: tableau_seq_gradient_pal
### Title: Tableau sequential colour gradient palettes (continuous)
### Aliases: tableau_seq_gradient_pal

### ** Examples

library("scales")
x <- seq(0, 1, length = 25)
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-tableau_shape_pal.R
@@ -1,8 +1,4 @@
### Name: tableau_shape_pal
### Title: Tableau Shape Palettes (discrete)
### Aliases: tableau_shape_pal

### ** Examples

show_shapes(tableau_shape_pal()(5))

Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-theme_base.R
@@ -1,8 +1,4 @@
### Name: theme_base
### Title: Theme Base
### Aliases: theme_base

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-theme_calc.R
@@ -1,8 +1,4 @@
### Name: theme_calc
### Title: Theme Calc
### Aliases: theme_calc

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) +
Expand Down
22 changes: 9 additions & 13 deletions inst/examples/ex-theme_economist.R
@@ -1,8 +1,4 @@
### Name: theme_economist
### Title: ggplot color theme based on the Economist
### Aliases: theme_economist theme_economist_white

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
Expand Down Expand Up @@ -32,16 +28,16 @@ p + theme_economist_white() +
## All white variant
p + theme_economist_white(gray_bg = FALSE) +
scale_colour_economist()
## Not run:
##D ## The Economist uses ITC Officina Sans
##D library(extrafont)
##D p + theme_economist(base_family="ITC Officina Sans") +
##D scale_colour_economist()
\dontrun{
## The Economist uses ITC Officina Sans
library(extrafont)
p + theme_economist(base_family="ITC Officina Sans") +
scale_colour_economist()
##D
##D ## Verdana is a widely available substitute
##D p + theme_economist(base_family="Verdana") +
##D scale_colour_economist()
## End(Not run)
## Verdana is a widely available substitute
p + theme_economist(base_family="Verdana") +
scale_colour_economist()
}



4 changes: 0 additions & 4 deletions inst/examples/ex-theme_excel.R
@@ -1,8 +1,4 @@
### Name: theme_excel
### Title: ggplot color theme based on old Excel plots
### Aliases: theme_excel

### ** Examples

library("ggplot2")
# Old line color
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-theme_few.R
@@ -1,8 +1,4 @@
### Name: theme_few
### Title: Theme based on Few's "Practical Rules for Using Color in Charts"
### Aliases: theme_few

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-theme_gdocs.R
@@ -1,8 +1,4 @@
### Name: theme_gdocs
### Title: Theme with Google Docs Chart defaults
### Aliases: theme_gdocs

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) +
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-theme_hc.R
@@ -1,8 +1,4 @@
### Name: theme_hc
### Title: Highcharts JS theme
### Aliases: theme_hc

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-theme_igray.R
@@ -1,8 +1,4 @@
### Name: theme_igray
### Title: Inverse gray theme
### Aliases: theme_igray

### ** Examples

library("ggplot2")
p <- ggplot(mtcars) +
Expand Down

0 comments on commit 97fae8a

Please sign in to comment.