You are previewing R Data Visualization Cookbook.
O'Reilly logo
R Data Visualization Cookbook

Book Description

Over 80 recipes to analyze data and create stunning visualizations with R

In Detail

R is an open source language for data analysis and graphics. It is platform-independent and allows users to load various packages as well as develop their own packages to interpret data better.

This book is packed with practical recipes, designed to provide you with all the guidance needed to get to grips with data visualization with R. It starts off with the basics of R plots and an introduction to heat maps and customizing them, before gradually taking you through creating interactive maps using the googleVis package, generating choropleth maps and contouring maps, bubble plots, and pie charts. You will then learn how to animate 2D and 3D plots in R. By the end of the book, you will be equipped with the key techniques to create impressive data visualizations with professional efficiency and precision.

What You Will Learn

  • Generate various plots in R using the basic R plotting techniques

  • Utilize R packages to add context and meaning to your data

  • Design interactive visualizations and integrate them on your website or blog

  • Communicate using visualization techniques, optimal for the underlying data being used as input

  • Create presentations and learn the basics of creating apps in R for your audience

  • Introduce users to basic R functions and data manipulation techniques while creating meaningful visualizations

  • Add elements, text, animation, and colors to your plot to make sense of data

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. R Data Visualization Cookbook
      1. Table of Contents
      2. R Data Visualization Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. A Simple Guide to R
        1. Installing packages and getting help in R
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        2. Data types in R
          1. How to do it…
        3. Special values in R
          1. How to do it…
          2. How it works…
        4. Matrices in R
          1. How to do it…
          2. How it works…
        5. Editing a matrix in R
          1. How to do it…
        6. Data frames in R
          1. How to do it…
        7. Editing a data frame in R
          1. How to do it...
        8. Importing data in R
          1. How to do it...
          2. How it works…
        9. Exporting data in R
          1. How to do it…
          2. How it works…
        10. Writing a function in R
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        11. Writing if else statements in R
          1. How to do it…
          2. How it works…
        12. Basic loops in R
          1. How to do it…
          2. How it works…
        13. Nested loops in R
          1. How to do it…
        14. The apply, lapply, sapply, and tapply functions
          1. How to do it…
          2. How it works…
        15. Using par to beautify a plot in R
          1. How to do it…
          2. How it works…
        16. Saving plots
          1. How to do it…
          2. How it works…
      9. 2. Basic and Interactive Plots
        1. Introduction
        2. Introducing a scatter plot
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Scatter plots with texts, labels, and lines
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        4. Connecting points in a scatter plot
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        5. Generating an interactive scatter plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. A simple bar plot
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        7. An interactive bar plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        8. A simple line plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        9. Line plot to tell an effective story
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        10. Generating an interactive Gantt/timeline chart in R
          1. Getting ready
          2. How to do it…
          3. See also
        11. Merging histograms
          1. How to do it…
          2. How it works…
        12. Making an interactive bubble plot
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        13. Constructing a waterfall plot in R
          1. Getting ready
          2. How to do it…
      10. 3. Heat Maps and Dendrograms
        1. Introduction
        2. Constructing a simple dendrogram
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
          5. See also
        3. Creating dendrograms with colors and labels
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Creating a heat map
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Generating a heat map with customized colors
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Generating an integrated dendrogram and a heat map
          1. How to do it…
          2. There's more…
          3. See also
        7. Creating a three-dimensional heat map and a stereo map
          1. Getting ready
          2. How to do it…
          3. See also
        8. Constructing a tree map in R
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      11. 4. Maps
        1. Introduction
        2. Introducing regional maps
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Introducing choropleth maps
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. A guide to contour maps
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        5. Constructing maps with bubbles
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. There's more…
          5. See also
        6. Integrating text with maps
          1. Getting ready
          2. How to do it…
          3. See also
        7. Introducing shapefiles
          1. Getting ready
          2. How to do it…
          3. See also
        8. Creating cartograms
          1. Getting ready
          2. How to do it…
          3. See also
      12. 5. The Pie Chart and Its Alternatives
        1. Introduction
        2. Generating a simple pie chart
          1. How to do it…
          2. How it works…
          3. There's more...
          4. See also
        3. Constructing pie charts with labels
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Creating donut plots and interactive plots
          1. Getting rady
          2. How to do it...
          3. How it works…
          4. There's more…
          5. See also
        5. Generating a slope chart
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Constructing a fan plot
          1. Getting ready
          2. How to do it…
          3. How it works…
      13. 6. Adding the Third Dimension
        1. Introduction
        2. Constructing a 3D scatter plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Generating a 3D scatter plot with text
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. A simple 3D pie chart
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. A simple 3D histogram
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        6. Generating a 3D contour plot
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Integrating a 3D contour and a surface plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
          5. See also
        8. Animating a 3D surface plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      14. 7. Data in Higher Dimensions
        1. Introduction
        2. Constructing a sunflower plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Creating a hexbin plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Generating interactive calendar maps
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Creating Chernoff faces in R
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Constructing a coxcomb plot in R
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Constructing network plots
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        8. Constructing a radial plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        9. Generating a very basic pyramid plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      15. 8. Visualizing Continuous Data
        1. Introduction
        2. Generating a candlestick plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Generating interactive candlestick plots
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Generating a decomposed time series
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        5. Plotting a regression line
          1. How to do it…
          2. How it works…
          3. See also
        6. Constructing a box and whiskers plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Generating a violin plot
          1. Getting ready
          2. How to do it…
        8. Generating a quantile-quantile plot (QQ plot)
          1. Getting ready
          2. How to do it…
          3. See also
        9. Generating a density plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        10. Generating a simple correlation plot
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      16. 9. Visualizing Text and XKCD-style Plots
        1. Introduction
        2. Generating a word cloud
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Constructing a word cloud from a document
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Generating a comparison cloud
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Constructing a correlation plot and a phrase tree
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Generating plots with custom fonts
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Generating an XKCD-style plot
          1. Getting ready
          2. How to do it…
          3. See also
      17. 10. Creating Applications in R
        1. Introduction
        2. Creating animated plots in R
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating a presentation in R
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. A basic introduction to API and XML
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Constructing a bar plot using XML in R
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Creating a very simple shiny app in R
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      18. Index