Search icon CANCEL
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
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

The graphics package


As it was mentioned before, graphics is the most basic graphical package in R. As with any other package, it contains a wide variety of functions (all dedicated to graphics, of course) but plot() is the most important one. plot() is a special type of function called a generic function, which is a function that can receive inputs of different classes but produces different outputs according to the class of the input.

This can be simply appreciated by plotting the different variables of the iris dataset:

Variable type

Plot

If a character or factor vector is passed (such as Species from the iris dataset), a bar graph is returned:

plot(iris$Species)

If a numeric vector is passed, a dispersion graph is returned:

plot(iris$Sepal.Length)

If two numeric vectors are passed, a scatterplot is returned:

plot(iris$Sepal.Length,iris$Sepal.Width)

If a numeric data frame or matrix is passed, a multiple scatterplot is created:

plot(iris)

As you might have already...

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 ₹800/month. Cancel anytime