Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Mastering RStudio: Develop, Communicate, and Collaborate with R
Mastering RStudio: Develop, Communicate, and Collaborate with R

Mastering RStudio: Develop, Communicate, and Collaborate with R: Harness the power of RStudio to create web applications, R packages, markdown reports and pretty data visualizations

Arrow left icon
Profile Icon Julian Hillebrand Profile Icon Nierhoff
Arrow right icon
$54.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (6 Ratings)
Paperback Dec 2015 348 pages 1st Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Julian Hillebrand Profile Icon Nierhoff
Arrow right icon
$54.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (6 Ratings)
Paperback Dec 2015 348 pages 1st Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

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

Mastering RStudio: Develop, Communicate, and Collaborate with R

Chapter 2. Communicating Your Work with R Markdown

This chapter covers the following topics:

  • Reproducible research with R Markdown
  • Getting started with the R Markdown interface
  • Customizing R code chunks and file output
  • Using templates and a custom style sheet
  • Creating presentations with R Markdown

The concept of reproducible research

The possibility of replicating studies and researches is essential for strengthening the scientific evidence of the related outcomes. Especially when it comes to public trials of the influence on important social decision-making processes; it is particularly relevant to disclose all data sets, analytical methods, and related findings. By enabling such transparency, it is possible for every interested person to reproduce the results of any scientific research. With this approach, all findings can be checked for accuracy and are thus, possibly, corrected or confirmed by third-parties, even though an analysis can be reproducible and still not valid. A basic reproducible workflow could look like the following:

The concept of reproducible research

Doing reproducible research with R Markdown

Since the concepts and methods of reproducible research have their own range of topics that could easily fill several books, we would like to focus on the abilities of R Markdown in conjunction with RStudio in this chapter. But first, we will give you a few introductory statements.

What is Markdown?

 

Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write, using an easy-to-read, easy-to-write plain text format, and then convert it to structurally valid XHTML (or HTML).

 
 --John Gruber, Creator of Markdown (http://daringfireball.net/projects/markdown/)

This simplification, and the fact that it is akin to the markup language, enables authors to perform a fast and intuitive formatting of text. Following are some examples:

  • The use of hashes will create headlines:
    # This is an H1 heading
    
    ## This is an H2 heading
    
    ### This is an H3 heading
    
    #### This is an H4 heading
  • If you want to create an ordered list, you...

Getting started with R Markdown in RStudio

Let's recapitulate, that R Markdown uses various technologies and is seamlessly embedded in RStudio.

Creating your first R Markdown document

To create an R Markdown document, perform the following steps:

  1. First, click on the new file icon in RStudio and select R Markdown....
    Creating your first R Markdown document
  2. This will open a new popup window where you can adjust a variety of settings.
    Creating your first R Markdown document
  3. For our first document, we will leave all these settings as they are. You may change the Title and the Author name.
  4. After hitting the OK button, RStudio will automatically open a new prefilled .Rmd file.
    Creating your first R Markdown document
  5. For a first test run, just click on the Knit HTML button with the small ball of yarn icon before the corresponding text.
    Creating your first R Markdown document

    As you can see, the knitted file opens by default in a preview window.

  6. Instead of using the default option, it is recommended that you change the settings so that RStudio opens the output of a knitted .Rmd file in a dedicated viewer pane. Click on the small down-pointing arrow, to the...

The R Markdown interface

After our first steps with R Markdown and our sample report, it is time to take a closer look at the R Markdown interface within the RStudio IDE.

Inspecting the R Markdowns panes

In the following screenshot, you can easily see that three panes play a role in the creation process of R Markdown documents:

Inspecting the R Markdowns panes

We already know the Files pane, where the code and text of the report can be created. As recommended, the output of the .Rmd file is shown in the Viewer pane. Next to the console pane is the R Markdown console, where you inspect the processing and creation of the .Rmd file. If there are any code errors in your R Markdown file, the execution will be stopped and two new buttons will appear in the right corner.

While the Output window shows the normal processing until reaching the first error, the Issues window shows only the respective errors and the associated line, where the error seems to be.

Explaining the R Markdown File pane settings

In the File pane, various settings...

Advanced R Markdown documents

After compiling our first R Markdown report, we want to go ahead and look at the advanced options for embedding code chunks with the knitr syntax. Also, you will learn how to brand your reports with custom style sheets.

Getting to know R code chunks

As we have already seen in our sample report, R Markdown uses so called code chunks to render R Code into reports.

Getting to know R code chunks

This exemplary code chunk shows the most elementary way to include an R code snippet in our .Rmd file. Just three back ticks, ``` at the beginning and end of the chunk, and the letter r in curly brackets, {r}.

Getting to know R code chunks

Even if it is a short code chunk, the output includes an H1 heading, the used R code, and a complete plot.

Customizing R code chunks

R Markdown offers a lot of options to customize your code chunks. This is necessary because, on the one hand, R Markdown includes all code lines and even error and warning messages by default. On the other hand, including many lines of code may distract readers from your...

The concept of reproducible research


The possibility of replicating studies and researches is essential for strengthening the scientific evidence of the related outcomes. Especially when it comes to public trials of the influence on important social decision-making processes; it is particularly relevant to disclose all data sets, analytical methods, and related findings. By enabling such transparency, it is possible for every interested person to reproduce the results of any scientific research. With this approach, all findings can be checked for accuracy and are thus, possibly, corrected or confirmed by third-parties, even though an analysis can be reproducible and still not valid. A basic reproducible workflow could look like the following:

Left arrow icon Right arrow icon

Key benefits

  • Discover the multi-functional use of RStudio to support your daily work with R code
  • Learn to create stunning, meaningful, and interactive graphs and learn to embed them into easy communicable reports using multiple R packages
  • Develop your own R packages and Shiny web apps to share your knowledge and collaborate with others.

Description

RStudio helps you to manage small to large projects by giving you a multi-functional integrated development environment, combined with the power and flexibility of the R programming language, which is becoming the bridge language of data science for developers and analyst worldwide. Mastering the use of RStudio will help you to solve real-world data problems. This book begins by guiding you through the installation of RStudio and explaining the user interface step by step. From there, the next logical step is to use this knowledge to improve your data analysis workflow. We will do this by building up our toolbox to create interactive reports and graphs or even web applications with Shiny. To collaborate with others, we will explore how to use Git and GitHub and how to build your own packages to ensure top quality results. Finally, we put it all together in an interactive dashboard written with R.

Who is this book for?

This book is aimed at R developers and analysts who wish to do R statistical development while taking advantage of RStudio's functionality to ease their development efforts. R programming experience is assumed as well as being comfortable with R's basic structures and a number of functions.

What you will learn

  • Discover the RStudio IDE and details about the user interface
  • Communicate your insights with R Markdown in static and interactive ways
  • Learn how to use different graphic systems to visualize your data
  • Build interactive web applications with the Shiny framework to present and share your results
  • Understand the process of package development and assemble your own R packages
  • Easily collaborate with other people on your projects by using Git and GitHub
  • Manage the R environment for your organization with Shiny server
  • Apply your obtained knowledge of R development to create a real-world dashboard solution
Estimated delivery fee Deliver to Thailand

Standard delivery 10 - 13 business days

$8.95

Premium delivery 5 - 8 business days

$45.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 04, 2015
Length: 348 pages
Edition : 1st
Language : English
ISBN-13 : 9781783982547
Category :
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Thailand

Standard delivery 10 - 13 business days

$8.95

Premium delivery 5 - 8 business days

$45.95
(Includes tracking information)

Product Details

Publication date : Dec 04, 2015
Length: 348 pages
Edition : 1st
Language : English
ISBN-13 : 9781783982547
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 $ 137.97
Mastering RStudio: Develop, Communicate, and Collaborate with R
$54.99
Learning Bayesian Models with R
$38.99
Learning Shiny
$43.99
Total $ 137.97 Stars icon
Banner background image

Table of Contents

11 Chapters
1. The RStudio IDE – an Overview Chevron down icon Chevron up icon
2. Communicating Your Work with R Markdown Chevron down icon Chevron up icon
3. R Lesson I – Graphics System Chevron down icon Chevron up icon
4. Shiny – a Web-app Framework for R Chevron down icon Chevron up icon
5. Interactive Documents with R Markdown Chevron down icon Chevron up icon
6. Creating Professional Dashboards with R and Shiny Chevron down icon Chevron up icon
7. Package Development in RStudio Chevron down icon Chevron up icon
8. Collaborating with Git and GitHub Chevron down icon Chevron up icon
9. R for your Organization – Managing the RStudio Server Chevron down icon Chevron up icon
10. Extending RStudio and Your Knowledge of R 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 Full star icon Half star icon 4.5
(6 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




adnan baloch Mar 16, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
An IDE is, without a doubt, the face of a programming language. A well thought out IDE can be instrumental to the popularity of a programming language, especially one whose usage is primarily confined to certain circles like the scientific community. The perfect IDE makes a programming language more accessible for the average user by highlighting syntax and pointing out errors before compilation. RStudio was created with these things in mind and more. It has become the definitive IDE for anyone looking to benefit from the rich libraries and powerful capabilities of the R language. The authors of this book take great pains to take readers through the features of the IDE, from how to accomplish mundane tasks to unlocking the vast potential of the R language. The wealth of information in this book is truly staggering, for it does not only deal with RStudio. Powerful interactive documents and dashboards are created using Shiny, a web framework for R that will excite beginners and seasoned users of R with its ease of use and professional look of the final result. The authors delve into the integration of RStudio with Git and Github, thus giving readers the recipe to develop solutions in collaboration with a team of developers anywhere in the world. Finally, the authors empower readers with knowledge of managing the RStudio server on online hosting services like AWS and present tips to stay up to date in the world of R. With step by step screenshots on just about every page, this book warrants a position on any serious R user's bookshelf.
Amazon Verified review Amazon
Duncan W. Robinson Mar 02, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Mastering RStudio – Develop, Communicate, and Collaborate with R is probably the best book I’ve seen to date covering RStudio. This is simply my opinion, but I loved the diverse mix of topics covered. For example, I’m itching to try out some of the RShiny examples in Chapters 5 & 6. Also, we’re increasingly using Git / GitHub at work; I’m hoping this book will give me some ideas on this front. I was pleasantly surprised by Mastering RStudio – I got a lot more than simply a book on using RStudio!
Amazon Verified review Amazon
Perry Nally Feb 17, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Tons of information and in-depth walk-throughs on how to create and present calculated data sets using all sorts of statistical analysis. I love that it helps me generate interactive websites and reports that look good. What's an analysis worth if you don't know how to present your findings? Don't get me wrong, this book is not all about how to present your findings, There are heaps of analysis tools to use which are powerful, but having the ability to generate more than an in-application graph that I have to use my own copy-paste techniques is a valuable asset.
Amazon Verified review Amazon
N/A Jan 22, 2024
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Feefo Verified review Feefo
Abhijit Dasgupta May 05, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Actually, the title of the book is misleading...most of the material has to do with R and DevOps and running things, not necessarily in RStudio. But it is a welcome bait-and-switch for the reader, since there is useful starting material inside. The introductions to markdown, Shiny, interactive visualizations and dashboards are nice, as well as information on how to get things running on AWS. However, I'm afraid that the title might steer readers away from this book. RStudio is merely a front end tool into the worlds of R, git, and others. Much of the chapters don't need to even refer to RStudio, since all the action happens in different environments. This book might have been better titled "Reporting, Visualization, and Collaboration using R and Friends".I actually like this book, though I don't love it. Pointers to further reading would make it a more complete experience. Also, there's not much to "Master" in RStudio -- it's really an introduction to other tools that can support the analyst, based in the R ecosystem. It is also already dated, since it doesn't incorporate the newer advances with RStudio Add-ins. It also ignores the option of having templates for rmarkdown documents that can help with a consistent look and feel of reports.
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 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 [email protected] 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 [email protected] 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 [email protected] 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 [email protected] 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 [email protected] 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 [email protected] 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