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
AU$41.99 AU$60.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (6 Ratings)
eBook Dec 2015 348 pages 1st Edition
eBook
AU$41.99 AU$60.99
Paperback
AU$75.99
Subscription
Free Trial
Renews at AU$24.99p/m
Arrow left icon
Profile Icon Julian Hillebrand Profile Icon Nierhoff
Arrow right icon
AU$41.99 AU$60.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (6 Ratings)
eBook Dec 2015 348 pages 1st Edition
eBook
AU$41.99 AU$60.99
Paperback
AU$75.99
Subscription
Free Trial
Renews at AU$24.99p/m
eBook
AU$41.99 AU$60.99
Paperback
AU$75.99
Subscription
Free Trial
Renews at AU$24.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

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

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 : 9781783982554
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 : Dec 04, 2015
Length: 348 pages
Edition : 1st
Language : English
ISBN-13 : 9781783982554
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
AU$24.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
AU$249.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 AU$5 each
Feature tick icon Exclusive print discounts
AU$349.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 AU$5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total AU$ 190.97
Mastering RStudio: Develop, Communicate, and Collaborate with R
AU$75.99
Learning Bayesian Models with R
AU$53.99
Learning Shiny
AU$60.99
Total AU$ 190.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

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.