Book Image

Learning Shiny

By : Hernan Resnizky
Book Image

Learning Shiny

By: Hernan Resnizky

Overview of this book

Table of Contents (19 chapters)
Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introducing R, RStudio, and Shiny
Index

Preface

R is a growing language that is gaining more and more space among data scientists. With over 7,000 packages, you can cover every stage within R: from data extraction, cleansing, and processing to advanced analysis, modelling, or visualization. In this context, Shiny is the tool that will take your R code to the next level, as you will be able to share all your outcomes with anyone through a dynamic web application. Shiny is not just a dashboard tool, but it is the gateway to unveiling hidden facts about data, even for nonexpert users. In other words, developing a Shiny application is like providing access to the R universe.

What this book covers

Chapter 1, Introducing R, RStudio, and Shiny, is a brief introduction to R, RStudio, and Shiny, and it contains the necessary information to install them.

Chapter 2, First Steps towards Programming in R, is a general introduction to some key concepts and basic operations in R.

Chapter 3, An Introduction to Data Processing in R, covers some techniques to clean and process data in R using the functions of specific packages. Data processing is definitely one of the key aspects to take into account in order to produce a successful application.

Chapter 4, Shiny Structure – Reactivity Concepts, introduces the reader to Shiny's internal structure and logic.

Chapter 5, Shiny in Depth – A Deep Dive into Shiny's World, examines the different possibilities within the Shiny structure for each of its components. For the user interface section, it presents the different elements available, and for the backend section, it gives some hints about how to optimally organize code.

Chapter 6, Using R's Visualization Alternatives in Shiny, covers the most important graphical packages in R and how to include their outcomes in a Shiny application. This is a key aspect when developing an application, as graphics are usually one of the most common ways to present information in a web application.

Chapter 7, Advanced Functions in Shiny, introduces some advanced functions to control more complex interactions and explains how to use them.

Chapter 8, Shiny and HTML/JavaScript, explains how to include custom JavaScript, HTML, and CSS code in a Shiny application, as Shiny's frontend is HTML-based/JavaScript-based.

Chapter 9, Interactive Graphics in Shiny, covers two topics, whose common root is interaction with graphics. Firstly, the newly released functionality of Shiny's event listener within R's standard graphics and then the generation of custom JavaScript visualizations, and how to include them in a Shiny application.

Chapter 10, Sharing Applications, introduces different possibilities to publish applications right from passing the entire code to uploading it to a server and making it accessible via URL.

Chapter 11, From White Paper to a Full Application, simulates a real-world situation where a web application is needed and explains the whole process from scratch in a holistic way. It not only explains the code, but also gives some tips about how to structure it and how to communicate with data.

What you need for this book

The software used in this book is free and open source and is available for Linux, Mac, and Windows. An internet connection is necessary for some of the topics covered in this book.

Who this book is for

This book is suitable even for readers with no experience in R, Shiny, or HTML at all. However, having some previous knowledge in any of these fields will definitely be an advantage to understand this book quickly.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "If it is a .rda or .RData file, it will open in both."

A block of code is set as follows:

#Load XML library
library(XML)

#URL Public API Worldbank Data Catalog in XML format
url <- "http://api.worldbank.org/v2/datacatalog?format=xml"

#Load XML document
xml.obj <- xmlTreeParse(url)

Any command-line input or output is written as follows:

> class(xml.obj)
[1] "XMLDocument"     "XMLAbstractDocument"

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In RStudio, whenever a function is declared, it will appear in the Environment section under the Functions section:"

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from: https://www.packtpub.com/sites/default/files/downloads/0900OS_ColoredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.