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
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Shiny

You're reading from   Learning Shiny Make the most of R's dynamic capabilities and implement web applications with Shiny

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781785280900
Length 246 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Hernan Resnizky Hernan Resnizky
Author Profile Icon Hernan Resnizky
Hernan Resnizky
Hernan Resnizky Hernan Resnizky
Author Profile Icon Hernan Resnizky
Hernan Resnizky
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Introducing R, RStudio, and Shiny FREE CHAPTER 2. First Steps towards Programming in R 3. An Introduction to Data Processing in R 4. Shiny Structure – Reactivity Concepts 5. Shiny in Depth – A Deep Dive into Shiny's World 6. Using R's Visualization Alternatives in Shiny 7. Advanced Functions in Shiny 8. Shiny and HTML/JavaScript 9. Interactive Graphics in Shiny 10. Sharing Applications 11. From White Paper to a Full Application Index

ggplot2 – first steps


ggplot2 (an acronym for Grammar of Graphics plot) is the most popular graphical package in R. This relies mainly on the fact that almost anything can be drawn with it. This huge flexibility, however, implies more complexity while drawing.

The underlying concept of ggplot2 is an empty canvas. Instead of specifying the type of plot and the data to be visualized, the ggplot2 functions expect vectors that denote positions, widths, sizes, and so on. From its conceptual point of view, this is very similar to an HTML document; this is an empty space that is filled with different objects to which different characteristics are specified. The following example is the equivalent of plot(iris$Sepal.Length):

ggplot.graph <- ggplot(data=iris)
ggplot.graph <- ggplot.graph + geom_point(aes(1:150,Sepal.Length))

plot(ggplot.graph)

This example is a typical ggplot code. As the reader might have already realized, its construction differs significantly from the other packages seen...

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