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 €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
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

Shipping Address

Billing Address

Shipping Methods
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.

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
Estimated delivery fee Deliver to Hungary

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

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 Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Hungary

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

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
€18.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
€189.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
€264.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 the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela