Formatting the output of inline code in R Markdown documents to make it look natural (CC063)
Channel: Riffomonas Project
Date: 2021-01-14

In today's episode of Code Club, Pat Schloss demonstrates how you can format the output of R Markdown's inline code. Often, the output of the inline code has way too many significant digits or large numbers lack the thousands separator. We'll show you how to get your values formatted so they look like you wrote them. We'll also see how to use a few arguments in the format function.

This episode is part of a larger arc of episodes investigating the sensitivity and specificity of amplicon sequence variants (ASVs), also known as exact sequence variants (ESVs). ASVs are growing in popularity for analyzing microbial communities using 16S rRNA gene sequences. Proponents think that they should supplant operational taxonomic units (OTUs). What do you think? Pat demonstrates these concepts by live coding at the command line interface using GitHub Flow, Make, and RStudio.

The accompanying blog post can be found at http://www.riffomonas.org/code_club/2021-01-14-formatting-inline

You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: http://www.riffomonas.org/minimalR/
General data: http://www.riffomonas.org/generalR/

0:00 Introduction
2:57 Creating a new code chunk
9:19 Turning off echo across document
11:05 Creating an inline hook
14:58 The format function
20:59 Testing for integers
23:46 Italics in markdown
26:26 Manually formatting inline output
29:55 Conclusion