Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ggplot2 Essentials

You're reading from   ggplot2 Essentials Explore the full range of ggplot2 plotting capabilities to create meaningful and spectacular graphs

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785283529
Length 234 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Donato Teutonico Donato Teutonico
Author Profile Icon Donato Teutonico
Donato Teutonico
Arrow right icon
View More author details
Toc

General aspects

The qplot (quick plot) function is a basic high-level function of ggplot2. The general syntax that you should use with this function is the following:

qplot(x, y, data, color, shape, size, facets, geom, stat)

The definitions of the various components of this function are as follows:

  • x and y: These represent the variables to plot (y is optional, with a default value of NULL).
  • data: This defines the dataset containing the variables.
  • color, shape and size: These are the aesthetic arguments that can be mapped on additional variables.
  • facets: This defines the optional faceting of the plot based on one variable contained in the dataset.
  • geom: This allows you to select the actual visualization of the data, which, basically, will define the plot that will be generated. The possible values are point, line, and boxplot, and we will see several different examples in the next pages.
  • stat: This defines the statistics to be used for the data.

These arguments represent the most important options...

lock icon The rest of the chapter is locked
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.
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 $19.99/month. Cancel anytime
Banner background image