Book Image

Web Application Development with R Using Shiny Second Edition - Second Edition

By : Chris Beeley
Book Image

Web Application Development with R Using Shiny Second Edition - Second Edition

By: Chris Beeley

Overview of this book

R is a highly flexible and powerful tool for analyzing and visualizing data. Most of the applications built using various libraries with R are desktop-based. But what if you want to go on the web? Here comes Shiny to your rescue! Shiny allows you to create interactive web applications using the excellent analytical and graphical capabilities of R. This book will guide you through basic data management and analysis with R through your first Shiny application, and then show you how to integrate Shiny applications with your own web pages. Finally, you will learn how to finely control the inputs and outputs of your application, along with using other packages to build state-of-the-art applications, including dashboards.
Table of Contents (14 chapters)
Web Application Development with R Using Shiny Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Adding icons to your UI


As we go through the various UI elements later, we're going to sprinkle a few icons throughout, just to give the page a bit more visual interest. Icons can come from two icon libraries, located at fontawesome.io/icons/ and getbootstrap.com/components/#glyphicons. They can be added simply using the icon() command with the name of the required icon given as a string.

For example, icon("user") will by default return icons from the fontawesome library, and to use the glyphicons, simply add lib = "glyphicon" as follows:

icon = icon("user", lib = "glyphicon")

They can be added directly to your UI or on buttons (including the buttons at the top of tab panels). From the full code of this application, you can see that we have replaced the boring horizontal rule, which separated our input widgets with a spinning Linux penguin (because, woo! Linux!) using class = "fa-spin". The class argument comes from the use of CSS classes to vary the characteristics of Font Awesome icons. The...