Why Learn R?
The R Language
R is a 30-year-old data programming language created by New Zealand statisticians Robert Gentleman and Ross Ihaka as a free alternative to proprietary software for their students at the University of Auckland. It was modelled after the S Programming Language, invented by John Chambers while at Bell Labs.
The language has evolved and the user community has grown considerably. R and Python are two of the most popular data programming languages used in academics and by professional data scientists.
R is currently supported by a large team of contributors, a Foundation, and thousands of contributed packages.*
To create robust and dynamic analysis we can use a couple of tools that were built to leverage the power of R to create compelling narratives.
Getting to Know RStudio
RStudio is a graphical user interface (GUI) and integrated developer environment (IDE) that makes it much easier to use R for writing code, importing data, installing packages, and other features.
A Guided Tour
The following video provides a tour of the RStudio interface and key components for getting started.
- What is RStudio?
- Executing and scripting commands
- Point-and-click and keyboard shorcuts
- Major interface components and features
Visit the video to navigate using timestamps in the description or bookmarks in the progress bar.
- (00:00) Introduction & Defining Integrated Development Environments (IDE)
- (00:41) The Five Key Components of RStudio
- (02:17) Using the Console vs. Using Scripts
- (04:29) Shortcuts: Jumping Around, Full Screen, Saving
- (05:27) How to Save an R Script
- (06:36) Shortcuts: Moving Between & Exiting Scripts
- (07:19) “Session” & Setting Working Directories
- (08:07) Exporting Data as CSV Files
- (09:04) “Tools” & Customizing Your RStudio Interface
- (10:02) “Help” & Accessing Cheat Sheets
- (10:42) Global Environment & Objects
- (13:20) RStudio’s Data Import Wizard
- (14:35) “Files” & Directory Contents
- (14:57) “Plots” & Graphics in R
- (15:44) “Help” & Documentation
- (17:01) Conclusions
Markdown
Markdown is a “lightweight”, easy-to-learn syntax that allows you to format language with boldface, italicization, bullet points, and more, even when there’s no “rich content editor” menu available.
Websites and applications that support Markdown may surprise you, including:
- Reddit
- GitHub
- RStudio
- OpenStreetMap
- Stack Exchange
- Microsoft Teams
Markdown Basics
The following video provides a brief introduction to Markdown fundamentals.
- Headers & Sub-Headers
- Boldface & Italicization
- Ordered & Unordered Lists
- List Sub-Items & Hyperlinks
Visit the video to navigate using timestamps in the description or bookmarks in the progress bar.
- (00:00) What Is Markdown?
- (01:17) Demonstrating Markdown in RStudio
- (02:00) Typing Human-Readable Language
- (02:27) Creating Headers
- (02:57) Creating Sub-Headers
- (04:35) Formatting Boldface & Italicization
- (05:58) Creating Unordered & Ordered Lists
- (07:04) Creating List Sub-Items
- (08:23) Formatting Hyperlinks
- (09:38) Conclusion
More Examples
The following video provides a tutorial and demonstration of R Markdown.
- Creating New R Markdown Files
- The Benefits of R Markdown
- Customizing & Compiling
Visit the video to navigate using timestamps in the description or bookmarks in the progress bar.
- (00:00) Introduction & Contents
- (00:22) Locating R Markdown Templates
- (01:20) Creating a New R Markdown File
- (02:36) Machine- & Human-Readable Code
- (05:41) Creating & Formatting from Scratch
- (06:19) Creating Code Chunks
- (07:37) Code Chunk Options
- (09:55) Lab Templates
- (12:25) Discussion