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
€23.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781782174349
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jan 29, 2016
Length: 194 pages
Edition : 2nd
Language : English
ISBN-13 : 9781782174349
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 107.97
Web Application Development with R Using Shiny Second Edition
€32.99
Learning Shiny
€32.99
Mastering RStudio: Develop, Communicate, and Collaborate with R
€41.99
Total 107.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.