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
$19.99 per month
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
$19.99 per month
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 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

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 : 9781783982547
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 : 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
Learning Shiny
$43.99
Learning Bayesian Models with R
$38.99
Mastering RStudio: Develop, Communicate, and Collaborate with R
$54.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 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.