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
Explore 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
Web Application Development with R Using Shiny Second Edition
Web Application Development with R Using Shiny Second Edition

Web Application Development with R Using Shiny Second Edition: Integrate the power of R with the simplicity of Shiny to deliver cutting-edge analytics over the Web , Second Edition

eBook
$31.99 $35.99
Paperback
$43.99
Hardcover
$38.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Web Application Development with R Using Shiny Second Edition

Types of Shiny application


In the first edition of this book, which was based on Shiny 0.6, there were only two types of application described. First, a fairly simple Bootstrap-themed interface with input widgets down the left and output (a single page or a tabbed output window) on the right. The second type is custom-built web pages with their own HTML and CSS files. Shiny has developed quite a bit since then, and there are actually many types of Shiny application and ways of building them. They are as follows:

  • Interactive markdown documents with Shiny widgets embedded

  • Shiny applications (default CSS, written entirely in R)

  • Web pages (for example, custom CSS, HTML, JavaScript, and jQuery)

In this chapter, we will be considering the first two: interactive documents first and then full applications. Chapter 3, Building Your Own Web Pages with Shiny, will cover the building of your own web pages with Shiny applications on them.

Interactive Shiny documents in RMarkdown

Interactive documents can be...

A minimal example of a fully Shiny application


The first thing to note is that Shiny programs are the easiest to build and understand using two scripts, which are kept within the same folder. They should be named server.R and ui.R. Throughout this book, all code will have the commented server.R and ui.R headers to indicate which code goes in which file. The code is available at github.com/ChrisBeeley/basicGoogleAnalytics2ndEdition.

ui.R of minimal example

The ui.R file is a description of the UI and is often the shortest and simplest part of a Shiny application. Note the use of the # character, which marks lines of code as comments that will not be run, but which are for the benefit of humans producing the following code:

library(shiny)                             # Line 1
shinyUI(fluidPage(                         # Line 2
  titlePanel("Minimal application"),       # Line 3
  sidebarLayout(                           # Line 4
    sidebarPanel(                          # Line 5
      textInput...

Widget types


Before we move on to a more advanced application, let's have a look at the main widgets that you will make use of within Shiny. I've built a Shiny application that will show you what they all look like, as well as showing their outputs and the type of data they return. To run it, just enter the following command:

> runGist(6571951)

This is one of the several built-in functions of Shiny that allow you to run code hosted on the Internet. Details about sharing your own creations in other ways are discussed in Chapter 7, Sharing Your Creations. The finished application looks like the following:

You can see the function names (checkboxGroupInput and checkboxInput) as numbered entries on the left-hand side of the panel; for more details, just type ?checkboxGroupInput at the console.

If you're curious about the code, it's available at gist.github.com/ChrisBeeley/6571951.

The Google Analytics application


Now that we've got the basics, let's build something useful. We're going to build an application that allows you to interactively query data from the Google Analytics API. There is no room within this book to discuss registering for and using the Google Analytics API; however, you will very likely wish to make use of the wonderful RGoogleAnalytics package if you want to get your own Analytics data into R. This package is on CRAN and can therefore be installed as usual by running install.packages("RGoogleAnalytics").

To keep things simple, we will concentrate on data from a website that I worked on. We'll also use a saved copy of the data that is loaded into the application the first time it runs. A full production of the application could obviously query the API every time it is launched or on a daily or weekly basis, depending on how many users you expect (the API limits the number of daily queries from each application).

Note

Note that we would not query the...

Advanced layout features


In this chapter, we have covered the most simple of the layout features in Shiny with the help of the sidebarLayout(), mainPanel(), and tabsetPanel() functions. In later chapters, we will build larger and more complex applications, including dashboards, and make use of more advanced layout features. It is worth pausing here briefly to take a quick look at the other types of layout that are available, so you can think about the best way to implement your own application as we go through the next couple of chapters.

There are essentially two more broad types of layout function that you can use in Shiny. The first uses the layout features of Bootstrap and allows you to precisely define the layout of your application using a grid layout. Essentially, Bootstrap asks you to define the UI as a series of rows. Each row can be further subdivided into columns of varying widths.

Each set of columns on a row has widths that add up to 12. In this way one can quite easily specify...

Summary


In this chapter we have covered a lot of ground. We've seen that Shiny applications are generally made up of two files: server.R and ui.R. You've learned what each part of the code does, including setting up ui.R with the position and type of inputs and outputs and server.R with the data processing functions, outputs, and any reactive objects that are required.

The optional exercises have given you a chance to experiment with the code files in this chapter, varying the output types, using different widgets, and reviewing and adjusting their return values as appropriate. You've learned about the default layout in Shiny, sidebarLayout(), as well as about the use of mainPanel() and tabsetPanel().

You've also learned about reactive objects and we've discussed when you might use reactive objects. There's more on finely controlling reactivity later in the book.

In the next chapter you're going to learn how to integrate Shiny with your own content, using HTML, CSS, and JavaScript.

Summary

In this chapter we have covered a lot of ground. We've seen that Shiny applications are generally made up of two files: server.R and ui.R. You've learned what each part of the code does, including setting up ui.R with the position and type of inputs and outputs and server.R with the data processing functions, outputs, and any reactive objects that are required.

The optional exercises have given you a chance to experiment with the code files in this chapter, varying the output types, using different widgets, and reviewing and adjusting their return values as appropriate. You've learned about the default layout in Shiny, sidebarLayout(), as well as about the use of mainPanel() and tabsetPanel().

You've also learned about reactive objects and we've discussed when you might use reactive objects. There's more on finely controlling reactivity later in the book.

In the next chapter you're going to learn how to integrate Shiny with your own content, using...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Use Shiny's built-in functions to produce engaging user interfaces, and integrate them into your own web pages
  • Implement powerful user-contributed packages to access graphics from the web, make your own dashboards, use interactive maps, and more
  • Extend Shiny using JavaScript and jQuery with minimal coding using this handy, step-by-step guide

Description

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.

Who is this book 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. No previous experience with R, Shiny, HTML, or CSS is required to begin using this book, although you should possess some previous experience with programming in a different language.

What you will learn

  • * Build interactive applications using Shiny s built-in widgets
  • * Use the built-in layout functions in Shiny to produce user-friendly applications
  • * Integrate Shiny applications with web pages and customize them using HTML and CSS
  • * Harness the power of JavaScript and jQuery to customize your applications
  • * Engage your users and build better analytics using interactive plots
  • * Debug your applications using Shiny s built-in functions
  • * Deliver simple and powerful analytics across your organization using Shiny dashboards
  • * Share your applications with colleagues or over the Internet using cloud services or your own server

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 29, 2016
Length: 194 pages
Edition : 2nd
Language : English
ISBN-13 : 9781785289682
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jan 29, 2016
Length: 194 pages
Edition : 2nd
Language : English
ISBN-13 : 9781785289682
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 142.97
Web Application Development with R Using Shiny Second Edition
$43.99
Learning Shiny
$43.99
Mastering RStudio: Develop, Communicate, and Collaborate with R
$54.99
Total $ 142.97 Stars icon

Table of Contents

8 Chapters
1. Getting Started with R and Shiny! Chevron down icon Chevron up icon
2. Building Your First Application Chevron down icon Chevron up icon
3. Building Your Own Web Pages with Shiny Chevron down icon Chevron up icon
4. Taking Control of Reactivity, Inputs, and Outputs Chevron down icon Chevron up icon
5. Advanced Applications I – Dashboards Chevron down icon Chevron up icon
6. Advanced Applications II – Using JavaScript Libraries in Shiny Applications Chevron down icon Chevron up icon
7. Sharing Your Creations Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.5
(10 Ratings)
5 star 30%
4 star 30%
3 star 10%
2 star 20%
1 star 10%
Filter icon Filter
Top Reviews

Filter reviews by




Jamshed Bharucha Jun 23, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very clear
Amazon Verified review Amazon
Oleg Okun Feb 16, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It may look a bit unusual to consider R as a language of web application development. However, Chris Beeley wrote this book where he disperses any doubts through a number of convincing examples, gradually rising in complexity. Of course, the basic R alone could not be responsible for this exploit: this is where Shiny comes to help (and to shine). Shiny is a web application framework for R allowing to convert data analysis carried out by R packages into interactive web applications without even knowing HTML, CSS, or JavaScript. Thus, R+Shiny can be a viable alternative to the traditional ways to develop web applications.The book is useful for those who already knows R well, but never before tried Shiny and turning to another language is not an option. Numerous code examples guide a reader from creating the first minimal application to designing a complex interactive dashboard.
Amazon Verified review Amazon
Oscar Jun 11, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excelente libro
Amazon Verified review Amazon
Pethuru Raj Mar 12, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Due to a series of humongous innovations and improvisations in the information and communication technology (ICT) domain, the amount of multi-structured data getting generated, captured, transformed, stocked, and subjected to a variety of investigations across industry verticals these days is growing exponentially. Considering the tremendous amount of data at hand, the mathematicians, statisticians, and data scientists need highly competent and cognitive tools and techniques to play around with all kinds of data to extract actionable insights to be shared with business executives, decision-makers, analysts, and researchers. Simply stating, the process of transitioning data into information and into knowledge is getting simplified and streamlined through a host of powerful languages, tools, and integrated platforms.The R language is becoming a popular tool for the data-driven world. Google and Facebook are using the R language heavily in their day-to-day operations. Undoubtedly R is also the tool of choice for data scientists at Microsoft, who apply machine learning to data from Bing, Azure, Office, and the Sales, Marketing and Finance departments. R is not only gaining its footprint in corporate corridors but also in academic institutions. Researchers are extensively using R language for their investigations. Data scientists need to gain the competency on data manipulation, data visualization, and machine learning. Implementing these in R is quite easy. The dplyr package in R makes data manipulation easy. Further on, ggplot2 is one of the best data visualization tools around. Similarly for machine learning, the contributions of R language are really immense. There are several books explaining the nitty-gritty of R towards the simplification of machine learning concepts.RStudio is an IDE that makes R easier to use and more productive. RStudio combines a set of productivity tools into a single environment. Shiny makes it incredibly easy to build interactive web applications with R. Shiny has automatic “reactive” binding between inputs and outputs and extensive pre-built widgets. Shiny allows creating interactive web applications using the excellent analytical and graphical capabilities of R.This book is full of practical examples and shows you how to write cutting-edge interactive content for the Web, right from a minimal example all the way to fully styled and extensible applications. This book includes an introduction to Shiny and R and takes you all the way to advanced functions in Shiny as well as using Shiny in conjunction with HTML, CSS, and JavaScript to produce attractive and highly interactive applications quickly and easily. It also includes a detailed look at other packages available for R, which can be used in conjunction with Shiny to produce dashboards, maps, advanced D3 graphics, among many things.
Amazon Verified review Amazon
Don't be afraid Nov 25, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
good and helpful
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon