Giter Club home page Giter Club logo

ggrandom's Introduction

ggrandom

R-CMD-check

The goal of ggrandom is to introduce CHAOS to ggplot2 by adding random themes and colors palettes.

Installation

Install the development version from GitHub with:

require("devtools")
install_github("emilhvitfeldt/ggrandom")

Example

use theme_random() to add a random theme. Setting chaos = TRUE lets theme_random() “ignore” the seed.

library(ggplot2)
library(ggrandom)

ggplot(mtcars, aes(mpg, disp)) +
  geom_point() +
  theme_random()

set.seed(1234)
ggplot(mtcars, aes(mpg, disp)) +
  geom_point() +
  theme_random(chaos = TRUE)

use scale_colour_random_c()/scale_fill_random_c() to add a random continuous color scale. Setting chaos = TRUE lets scale_colour_random_c()/scale_fill_random_c() “ignore” the seed.

library(ggplot2)
library(ggrandom)

ggplot(mtcars, aes(mpg, disp, color = drat)) +
  geom_point() +
  scale_colour_random_c()

set.seed(1234)
ggplot(mtcars, aes(mpg, disp, color = drat)) +
  geom_point() +
  scale_colour_random_c(chaos = TRUE)

use scale_colour_random_d()/scale_fill_random_d() to add a random discrete color scale. Setting chaos = TRUE lets scale_colour_random_d()/scale_fill_random_d() “ignore” the seed.

library(ggplot2)
library(ggrandom)

ggplot(mtcars, aes(mpg, disp, color = factor(vs))) +
  geom_point() +
  scale_colour_random_d()

set.seed(1234)
ggplot(mtcars, aes(mpg, disp, color = factor(vs))) +
  geom_point() +
  scale_colour_random_d(chaos = TRUE)

Example (gif)

ggrandom's People

Contributors

emilhvitfeldt avatar delabj avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.