Reader small image

You're reading from  Instant Heat Maps in R How-to

Product typeBook
Published inJun 2013
Reading LevelIntermediate
PublisherPackt
ISBN-139781782165644
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Sebastian Raschka
Sebastian Raschka
author image
Sebastian Raschka

Sebastian Raschka is an Assistant Professor of Statistics at the University of Wisconsin-Madison focusing on machine learning and deep learning research. As Lead AI Educator at Grid AI, Sebastian plans to continue following his passion for helping people get into machine learning and artificial intelligence.
Read more about Sebastian Raschka

Right arrow

Preface

This book is about the construction of heat maps using the popular statistical programming language R. Heat maps are valuable tools for exploratory data analyses in many different applications, such as gene expression levels or stock market data. Together with powerful clustering methods, heat maps are being used to visually detect interesting patterns at one glance, even in very large data sets with hundreds of variables.

This book is a hands-on guide to provide you with a practical approach to construct such powerful heat maps. You will explore the advanced features of heat maps step-by-step, and detailed explanations on the underlying code at the end of each recipe will provide you with enough information to frame those heat maps as per your needs.

What this book covers

Creating your first heat map in R (Simple) will help you create your first heat maps from a small data set provided in R. You will use different heat map functions in R to get a first impression of their functionalities.

Reading data from different file formats (Intermediate) will help you learn how to read data from various popular file formats. After you have created your first heat maps, it is important to learn how to get your own data into R using differently formatted datasets.

Customizing heat maps (Intermediate) will help you explore more advanced functions to customize the layout of the heat maps. The main focus lies on the usage of different color palettes, but we will also cover other useful features, such as cell notes that will be used in this recipe.

Drawing choropleth maps and contour plots (Intermediate) will help you learn to create choropleth maps of the United States and other countries. Choropleth maps are a great way to visualize data from different regions on a geographical map. Also, you will learn how to visualize a 3D surface using a contour plot.

Exporting for presentation (Simple) will help you export heat maps in various popular image formats. By comparing images with different resolutions and file sizes, you will learn how to find the best-suited format for presenting your heat map.

Bringing your data to life (Advanced) will help you learn how to manipulate heat map image files to add interactivity, such as mouse-over and hover effects and fading in of supporting information.

What you need for this book

To ensure that the scripts can be used effectively, it is recommended to have a recent version of R (2.15.0 or higher) installed on your computer.

For the last recipe, a modern web browser, such as Google Chrome, Internet Explorer 10, or Safari, will be required to visualize the interactive heat maps. Note that recent versions of Firefox (18.0 or higher) have problems with the optional zoom and panning features of the interactive heat maps.

Who this book is for

This book is great for researchers and scientists, who want to make use of this free and great open source software to get the most out of their data analysis. It is recommended that you have at least some experience in using R and know how to run basic scripts from the command line. However, knowledge of other statistical scripting languages, such as Octave, S-Plus, or MATLAB, will suffice to follow through the recipes.

A strong background in Statistics is not required.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "To add tool tips to our heat map, the HeatModSVG program will prompt us for a data file in addition to the SVG file that we want to modify."

A block of code is set as follows:

if (!require("gplots")) {
install.packages("gplots", dependencies = TRUE)
library(gplots)
}
if (!require("MASS")) {
install.packages("MASS", dependencies = TRUE)
library(MASS)
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

-- "t" for tab
-- "c" for comma
: c
Column names? (y/n): y
Row names? (y/n): n

Read in data from car_data.csv:

Any command-line input or output is written as follows:

update.packages("gplots")
update.packages("lattice")

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "First, the program asks us whether we want to add Tool Tips or Zoom and Panning or both."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

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.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Instant Heat Maps in R How-to
Published in: Jun 2013Publisher: PacktISBN-13: 9781782165644
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Sebastian Raschka

Sebastian Raschka is an Assistant Professor of Statistics at the University of Wisconsin-Madison focusing on machine learning and deep learning research. As Lead AI Educator at Grid AI, Sebastian plans to continue following his passion for helping people get into machine learning and artificial intelligence.
Read more about Sebastian Raschka