R Graph Essentials
eBook - ePub

R Graph Essentials

David Alexander Lillis

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

R Graph Essentials

David Alexander Lillis

Book details
Book preview
Table of contents
Citations

About This Book

R has undergone an explosion of popularity around the world. The wide range of graphs and options for creating high-impact visualizations makes R a highly effective tool for researchers, data analysts, students, and others.

This book starts with the basics of R and the principles of creating graphics, focusing on scatterplots and line graphs for research and data analysis.

After that you will learn how to include mathematical expressions on your graphs and create bar charts, histograms, boxplots, and so on using advanced functions. The book then dives deeper into shading and coloring your graphs and labeling points on graphs using the qplot function. After that you will learn how to use the ggplot package to control symbol color, size, shape, and many other attributes.

By the end of this book, you will have expert skills to create attractive and informative graphics and design professional-level graphs.

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 R Graph Essentials an online PDF/ePUB?
Yes, you can access R Graph Essentials by David Alexander Lillis in PDF and/or ePUB format, as well as other popular books in Computer Science & Open Source Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2014
ISBN
9781783554553
Edition
1

R Graph Essentials


Table of Contents

R Graph 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. Base Graphics in R – One Step at a Time
Learning basic graphics techniques
Creating and joining points
Creating scatterplots and line plots
Colors in R
Passing parameter values to titles and labels
Including a regression line
Graphing mathematical functions
R provides many options
Creating graphs with several curves
Customizing your axes
Creating axis labels
Creating multiple graphs on the same page
Saving your graphs
Including mathematical expressions on your plots
Summary
2. Advanced Functions in Base Graphics
Reading datasets into R
Including a regression line and residuals
A medical dataset to create graphs
Creating complex multiple axes
Superposing graphs
Creating point labels
Including a grid on your graph
Shading and coloring your graph
Using polygon() to shade under a normal curve
Creating bar charts
Including a legend
Creating histograms
Creating boxplots
Creating pie charts
Creating dotcharts
R's color palettes
Using smoothers on your graph
Creating scatterplot matrices
Writing functions to create graphs
Including error bars on your graph
Summary
3. Mastering the qplot Function
About qplot
The qplot syntax
Producing scatterplots using qplot
Subsetting your data before graphing
Mapping aesthetics to categorical variables
Controlling colors on your graph
Setting up graphs as objects
Creating facet plots
Creating line graphs using qplot
Creating multiple curves simultaneously
Including smoothed curves
Creating histograms with qplot
Creating facet plots for histograms
Creating kernel density plots
Creating bar charts
Creating boxplots
Creating graphs with dates
Summary
4. Creating Graphs with ggplot
Getting started with ggplot
Mapping color, shape, and size to a variable
Modifying the plotting background
Controlling the legend name and legend labels
Modifying the x and y axes
Creating attractive color schemes
Creating curves for each factor level
Creating histograms
Creating bar charts
Creating a stacked bar chart
Creating a grouped bar chart
Creating a faceted bar chart
Creating boxplots
Labeling points with text
Mapping color to text
Including regression lines
Summary
Index

R Graph Essentials

Copyright © 2014 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: September 2014
Production reference: 1150914
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78355-455-3
www.packtpub.com
Cover image by Arvind Shetty ()

Credits

Author
David Alexander Lillis
Reviewers
Mzabalazo Z. Ngwenya
Donato Teutonico
Tengfei Yin
Commissioning Editor
Pramila Balan
Acquisition Editor
Reshma Raman
Content Development Editor
Akashdeep Kundu
Technical Editor
Rohit Kumar Singh
Copy Editors
Roshni Banerjee
Adithi Shetty
Project Coordinator
Kartik Vedam
Proofreaders
Simran Bhogal
Maria Gould
Ameesha Green
Indexer
Hemangini ...

Table of contents