Web Application Development with R using Shiny
eBook - ePub

Web Application Development with R using Shiny

  1. 110 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Web Application Development with R using Shiny

About this book

In Detail

R is a highly flexible and powerful tool for analyzing and visualizing data. Shiny is the perfect companion to R, making it quick and simple to share analysis and graphics from R that users can interact with and query over the Web. Let Shiny do the hard work and spend your time generating content and styling, not writing code to handle user inputs.

Web Application Development with R Using Shiny is an accessible introduction to sharing interactive content from R using Shiny. You will learn by doing, with each chapter including code and examples to use and adapt for your own applications. By the end of this book, you will be able to build useful and engaging web applications with only a few lines of code no JavaScript required.

Web Application Development with R Using Shiny will show you how to begin analyzing, visualizing, and sharing your data using practical examples.

This book will teach you how to rapidly prototype and build interactive data summaries using Shiny's built-in widgets and functions. You will learn how to integrate Shiny applications with your existing HTML and CSS, how to greatly extend the power and usability of your applications using JavaScript, and how to quickly deploy them over the Web.

The book uses practical examples to show you how to get the best out of R and Shiny, helping you to produce and share cutting-edge analytics with minimal effort.

Approach

This book follows a standard tutorial-based approach which will teach you how to make a web app using R and Shiny quickly and easily.

Who this book is for

This book is for anybody who wants to produce interactive data summaries over the Web, whether you want to share them with a few colleagues or the whole world. You need no previous experience with R, Shiny, HTML, or CSS to begin using this book, although you will need at least a little previous experience with programming in a different language.

Trusted by 375,005 students

Access to over 1 million titles for a fair monthly price.

Study more efficiently using our study tools.

Web Application Development with R Using Shiny


Table of Contents

Web Application Development with R Using Shiny
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Installing R and Shiny and Getting Started!
Installing R
The R console
Code editors and IDEs
Simple and well-featured
Complex and extensible
Learning R
Getting help
Loading data
Dataframes, lists, arrays, and matrices
Variable types
Functions
Objects
Base graphics and ggplot2
Bar chart
Line chart
Installing Shiny and running the examples
Summary
2. Building Your First Application
Program structure
ui.R of minimal example
server.R of minimal example
Optional exercise
Widget types
Google Analytics application
The UI
Data processing
Reactive objects
Outputs
A note on the application code
Optional exercise
Summary
3. Building Your Own Web Pages with Shiny
Running the applications and code
Shiny and HTML
Custom HTML links in Shiny
ui.R
server.R
server.R – data preparation
server.R – server definition
Minimal HTML interface
index.html
server.R
JavaScript and Shiny
ui.R
server.R
jQuery
index.html – body
server.R
jQuery
Exercise
Summary
4. Taking Control of Reactivity, Inputs, and Outputs
Showing and hiding elements of the UI
Giving names to tabPanel elements
Reactive user interfaces
Reactive user interface example – server.R
Reactive user interface example – ui.R
Advanced reactivity
Using reactive objects and functions efficiently
Controlling the whole interface with the submitButton() function
Controlling specific inputs with the isolate() function
Running reactive functions over time
More advanced topics in Shiny
Finely controlling inputs and outputs
Reading client information and GET requests in Shiny
Custom interfaces from GET strings
Animation
Advanced graphics options
Downloading graphics
Downloading and uploading data
Summary
5. Running and Sharing Your Creations
Sharing with the R community
Sharing over GitHub
Introduction to Git
Sharing applications using Git
Sharing using .zip and .tar
Sharing with the world
Glimmer
Shiny Server
Browser compatibility
Summary
Index

Web Application Development with R Using Shiny

Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2013
Production Reference: 1151013
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-447-4
www.packtpub.com
Cover Image by Suresh Mogre ()

Credits

Author
Chris Beeley
Reviewers
Neependra Khare
Ram Narasimhan
Hernán G. Resnizky
Acquisition Editor
Kevin Colaco
Commissioning Editor
Shaon Basu
Technical Editors
Aparna Chand
Dennis John
Project Coordinator
Suraj Bist
Proofreader
Joanna McMahon
Indexers
Monica Ajmera Mehta
Tejal R. Soni
Production Coordinator
Prachali Bhiwandkar
Cover Work
Prachali Bhiwandkar

About the Author

Chris Beeley is an Applied Researcher working in healthcare in the UK. He completed his PhD in Psychology at the University of Nottingham in 2009 and now works with Nottinghamshire Healthcare NHS Trust providing statistical analysis and other types of evaluation and reporting using routine data generated within the Trust. Chris has a special interest in the use of regression methods in applied healthcare settings, particularly forensic psychiatric settings, as well as in the collection, analysis, and reporting of patient feedback data.
Chris has been a keen user of R and a passionate advocate of open-source tools within research and healthcare settings since completing his PhD. He has made extensive use of R (and Shiny) to automate analysis and reporting for new patient feedback websites. This was funded by a grant from the NHS Institute for Innovation and made in collaboration with staff, service users, and carers within the Trust, particularly individuals from the Involvement Center.

Acknowledgement

I would like to thank all the staff, service users, and carers at the Involvement Center in Nottinghamshire Healthcare NHS Trust, not only for welcoming me and believing in me but also for making my work meaningful. Helping to better understand and communicate with our service users and carers is the reason why I get out of bed in the morning and work long hours on the website. The book was made much easier with the thought that it might help transform healthcare for everyone's benefit.
I'd like to give a massive thank you to the whole R world, the R core team, the people at RStudio, Joe Cheng, Winston Chang, Hadley Wickham (what was life like before ggplot2?) and all the people I've had so much help from over the years, on mailing lists, forums, blog posts, and wherever else I've found you. Everyone who believes in free and open source believes that by cooperating and sharing we can build a better world, and this is a profound message not just in the world of software, but globally everywhere. I could never hope to give back as much to this community as I've taken already, but I promise to try.
I would also like to thank my wife and son who helped me remember that there's more to life than coding and work, and are, in general, the complete opposite of writing a book about an R package.

About the Reviewers

Neependra Khare has around 9 years of experience in the IT industry. He has worked as a SysAdmin, support engineer, and a filesystem developer. Currently he is working with Red Hat as Principal Software Engineer.
As a data enthusiast, he uses R and Shiny to do the analysis and publish visualizations. More can be found out about him on his website at www.neependra.net.
Ram Narasimhan works in the Data Science group at GE Global Research. He has worked in applied data analysis for over 15 years, including working as a data consultant in multiple verticals (transportation, manufacturing, and sup...

Table of contents

  1. Web Application Development with R Using Shiny

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Web Application Development with R using Shiny by Chris Beeley in PDF and/or ePUB format, as well as other popular books in Informatique & Développement d'applications. We have over one million books available in our catalogue for you to explore.