项目作者: timcdlucas

项目描述 :
Pokemon themed colour schemes for R.
高级语言: R
项目地址: git://github.com/timcdlucas/palettetown.git
创建时间: 2015-08-12T16:48:09Z
项目社区:https://github.com/timcdlucas/palettetown

开源协议:Other

下载


palettetown

Total Downloads
Build Status

An R package providing pokemon colour palettes.

This package is very much inspired by pokepalettes.

Note that Pokemon, pokedex and all pokemon names are trademarks of Nintendo. I own nothing.

Installation

To install from CRAN

  1. install.packages('palettetown')
  2. library(palettetown)

To install development version

  1. library(devtools)
  2. install_github('timcdlucas/palettetown')
  3. library(palettetown)

Usage

See palettes

  1. # Show ten of the better palettes
  2. pokedex()

plot of chunk pokedex

  1. # Show ten palettes starting from pokemon #155
  2. # Get 7 fairly distinct colours for each.
  3. pokedex(155, 7)

plot of chunk pokedex

  1. # Show ten palettes starting from Metapod
  2. pokedex('Metapod')

plot of chunk pokedex

  1. # Show ten palettes that are fairly colour blind friendly
  2. pokedex(cb = 1)

plot of chunk pokedex

Base graphics

  1. plot(rnorm(20), rnorm(20), col = pokepal(pokemon = 137, spread = 6), pch = 16, cex = 1.8)

plot of chunk base

ggplot2

  1. # palettetown doesn't import ggplot2
  2. library(ggplot2)
  3. qplot(Sepal.Length, Sepal.Width, colour = Species, data=iris, size = 2) +
  4. scale_colour_poke(pokemon = 156, spread = 3)

plot of chunk ggplot2

  1. qplot(factor(carb), data=mtcars, geom="bar",
  2. fill = factor(carb)) +
  3. scale_fill_poke(pokemon = 'Quilava', spread = 6)

plot of chunk ggplot2