ggplot2 Essentials
eBook - ePub

ggplot2 Essentials

Donato Teutonico

Share book
  1. 234 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

ggplot2 Essentials

Donato Teutonico

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is ggplot2 Essentials an online PDF/ePUB?
Yes, you can access ggplot2 Essentials by Donato Teutonico in PDF and/or ePUB format, as well as other popular books in Informatique & Visualisation de données. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781785283529

ggplot2 Essentials


Table of Contents

ggplot2 Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Graphics in R
Getting ggplot2 up and running
Packages in R
The Integrated Development Environment
RStudio
Eclipse and StatET
Emacs and ESS
The plotting environments in R
Standard graphics and grid-based graphics
Graphics and standard plots
Scatterplots with individual data points
Scatterplots with the line of one tree
Scatterplots with the line and points of one tree
Boxplots of the orange dataset
Boxplots with individual observations
Histograms of the orange dataset
Histograms with the reference line at the median value in red
Lattice and Trellis plots
Scatterplots with individual observations
Scatterplots of the orange dataset with faceting
Faceting scatterplots with line and points
Scatterplots with grouping data
Boxplots of the orange dataset
Histograms of the orange dataset
Histograms with the reference line at the median value in red
ggplot2 and the grammar of graphics
Further reading
Summary
2. Getting Started
General aspects
Introduction to aesthetic attributes
Introduction to faceting
Histograms and density plots
Bar charts
Boxplots
Scatterplots
Time series
Bubble charts and dot plots
Further reading
Summary
3. The Layers and Grammar of Graphics
Components of layered grammar
Creating a plot layer by layer with the ggplot function
Scales
The coordinate system
Faceting
Grid faceting
Wrap faceting
Layers in ggplot2
Data
Aesthetic mapping
Geometric
Stat
Position adjustment
Position adjustment of categorical data
Position adjustment of continuous data
Equivalent coding between qplot and ggplot
Histograms and density plots
Bar charts
Boxplots
Scatterplots
Further reading
Summary
4. Advanced Plotting Techniques
Adding statistics
Smooth lines
Linear regression
Statistics with faceting
Advanced aesthetic mapping
Typical aesthetic mappings available in ggplot2
Mapping the aesthetic to new stat variables
Difference in mapping continuous and categorical variables
Adding text and reference lines to plots
Add text and reference lines with facets
Plots with polar coordinates
A pie chart
A bullseye chart
A coxcomb diagram
Further reading
Summary
5. Controlling Plot Details
Exploring scales
The plot title and axis labels
Axis scales
The discrete axis
The continuous axis
Axis transformations
Legends
The legend title
Legend keys and key labels
Themes
Themes for the legend
Themes for the axis and title
Themes for the plot background
Themes with facets
Further reading
Summary
6. Plot Output
Multiple plots in one page
Arranging plots in rows and columns
Specifying the plot position
Saving plots to a file
Saving the plot manually
Saving the plot to a file without rendering it
Saving a single plot
Saving multiple plots on the same PDF file
Saving the plot after rendering it
Further reading
Summary
7. Special Applications of ggplot2
Plotting maps with ggplot2 and ggmap
Mapping representations with ggplot2 and maps
Representing maps with ggmap
Scatterplot matrix with GGally
Plotting heatmaps with ggplot2
Further reading
Summary
Index

ggplot2 Essentials

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2015
Production reference: 1220615
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-352-9
www.packtpub.com

Credits

Author
Donato Teutonico
Reviewers
Juanjo Abellan
Niels W. Hanson
Sefa Kilic
Commissioning Editor
Julian Ursell
Acquisition Editors
Tushar Gupta
Owen Roberts
Content Development Editor
Samantha Gonsalves
Technical Editor
Siddhesh Patil
Copy Editor
Sarang Chari
Project Coordinator
Kinjal Bari
Proofreader
Safis Editing
Indexer
Monica Mehta
Graphics
Disha Haria
Jason Monteiro
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta

About the Author

Donato Teutonico has received his PharmD degree from the University of Turin, Italy, where he specialized in chemical and pharmaceutical technology, and his PhD in pharmaceutical sciences from Paris-South University, France. He has several years of experience in the modeling and simulation of drug effects and clinical trials in industrial and academic settings. Donato has contributed to numerous scientific projects and publications in internation...

Table of contents