Coder Social home page Coder Social logo

condformat's Introduction

Introduction to condformat

Sergio Oller 2016-06-27

condformat renders a data frame in which cells in columns are formatted according to several rules or criteria.

Downloads Build Status codecov.io

Browse source code

Checkout the code and browse it at http://github.com/zeehio/condformat.

How to install condformat:

Dependencies

If you want to use the PDF output you will need the xcolor LaTeX package. Either use the full texlive distribution, or install latex-xcolor on Debian and derivatives.

Package installation

  • From CRAN:

    install.packages("condformat")
    
  • To install the latest development version:

    devtools::install_github("zeehio/condformat")
    

Example

The example is properly formatted at http://zeehio.github.io/condformat.

data(iris)
library(condformat)
condformat(iris[c(1:5,70:75, 120:125),]) +
  rule_fill_discrete(Species) + 
  rule_fill_discrete(Sepal.Width, Sepal.Length,
                     expression = Sepal.Width > Sepal.Length - 2.25,
                     colours = c("TRUE" = "#7D00FF")) + 
  rule_fill_gradient2(Petal.Length)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5.0 3.6 1.4 0.2 setosa
6 5.6 2.5 3.9 1.1 versicolor
7 5.9 3.2 4.8 1.8 versicolor
8 6.1 2.8 4.0 1.3 versicolor
9 6.3 2.5 4.9 1.5 versicolor
10 6.1 2.8 4.7 1.2 versicolor
11 6.4 2.9 4.3 1.3 versicolor
12 6.0 2.2 5.0 1.5 virginica
13 6.9 3.2 5.7 2.3 virginica
14 5.6 2.8 4.9 2.0 virginica
15 7.7 2.8 6.7 2.0 virginica
16 6.3 2.7 4.9 1.8 virginica
17 6.7 3.3 5.7 2.1 virginica

condformat's People

Contributors

zeehio avatar

Watchers

 avatar  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.