GithubHelp home page GithubHelp logo

r-visualization's Introduction

R-Visualization

GG plots – Grammar of graphics

  • **Data layer** – data which visualization to be done
  • **Aesthetics layer** – metrics/scales onto which data has to be mapped – X, Y, shape, size, col
  • **Geometric layer** – Type of plots/geometry which has to be created – histogram, bar, box etc
  • **Facet layer** – dividing the plot into subgroups/facets -
  • **Theme layer** – adding themes to the final layer

    histogram

    ggplot(data = diamonds,aes(x=price)) + geom_histogram(fill="green",col="red")

    Setting binwidth

    ggplot(data = diamonds,aes(x=price)) + geom_histogram(fill="green",col="red",bins = 10)

    bar plot

    ggplot(data = diamonds,aes(x=cut)) + geom_bar () ggplot(data = diamonds,aes(x=cut)) + geom_bar (fill="palegreen",col="orange")

    table(diamonds$cut) Fair Good Very Good Premium Ideal 1610 4906 12082 13791 21551

    scatter-plot

    ggplot(data = diamonds,aes(x=carat,y=price)) + geom_point() ggplot(data = diamonds,aes(x=carat,y=price)) + geom_point (col="orange")

    continous numerical value scatter-plot

    ggplot(data = diamonds,aes(x=carat,y=price,col=price)) + geom_point ()

    categorical data value scatter-plot

    ggplot(data = diamonds,aes(x=carat,y=price,col=cut)) + geom_point ()

    Boxplot - numerical & categorical distribution

    ggplot(data = diamonds,aes(x=clarity,y=carat,col=cut)) + geom_boxplot() ggplot(data = diamonds,aes(x=clarity,y=carat,fill=clarity)) + geom_boxplot() ggplot(data = diamonds,aes(x=clarity,y=carat)) + geom_boxplot()

    ggplot(data = diamonds,aes(x=price)) + geom_histogram (fill="khaki3",col="lavenderblush4") ggplot(data = diamonds,aes(x=price,fill=price)) + geom_histogram ()

  • r-visualization's People

    Contributors

    nammoooo avatar

    Watchers

     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.