Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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
Author (1):
Arrow left icon
Hernan Resnizky Hernan Resnizky
Author Profile Icon Hernan Resnizky
Hernan Resnizky
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
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

reshape2


reshape2 is a package that consists mainly of two functions: melt and dcast/acast. Generally, it could be said that melt() transforms one row to multiple and shorter rows while dcast() and acast() do exactly the opposite.

The melt() function, basically, transforms one row of data to many by pivoting a set of variables (the measure variables) over a set of other variables (the id variables). The function is called as follows:

melt(dataset,id.vars,measure.vars,variable_name)

The id variables are usually factors or characters while the measure variables are the numeric ones. In fact, this is the behavior by default if none of the arguments are specified. variable_name is the name that adopts the column where the variables are specified (variable by default):

> library(reshape2)
> data(iris)
> melt(iris)
Using Species as id variables
Species      variable    value
1 setosa   Sepal.Length   5.1
2 setosa   Sepal.Length   4.9
3 setosa   Sepal.Length   4.7
4 setosa   Sepal.Length...
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 £13.99/month. Cancel anytime
Visually different images