R
Completed
-
Section 1: Getting Started
-
Section 2: Core Syntax
-
Section 3: Data Structures
-
Section 4: Data Manipulation
-
Section 5: Visualization and Statistics
-
Section 6: Advanced R
-
Section 7: Practical Projects
-
Section 8: Interview Practice
-
Section 9: More Practice Exercises
-
Section 10: Shiny Apps in Depth
-
Section 11: More Data Wrangling
-
Section 12: Tidyverse Deep Dive
-
Section 13: Statistical Modeling Deep Dive
-
Section 14: Machine Learning in R
-
Section 15: R Visualization Deep Dive
-
Section 16: R Package Development Deep Dive
-
Section 17: R for Reproducible Research
-
Section 18: R and Databases
-
Section 19: R Performance Optimization
-
Section 20: Bioinformatics and Specialized R
-
Section 21: More Shiny Practice
-
Section 22: More Practice Exercises
-
Section 23: R Data Structures Deep Dive
-
Section 24: More Interview and Review
-
Section 25: R for Business Analytics
-
Section 26: R Text Mining and NLP
-
Section 27: R Spatial Data Analysis
-
Section 28: R Deep Learning
-
Section 29: Advanced Statistical Techniques
-
Section 30: R Object Systems Deep Dive
-
Section 31: R Environments and Metaprogramming
-
Section 32: R for Finance
-
Section 33: R for Clinical and Health Data
-
Section 34: More Shiny Advanced Practice
-
Section 35: R Data Cleaning Deep Dive
-
Section 36: R Reporting Automation
-
Section 37: More Practical Projects Round 2
-
Section 38: R Ecosystem and Career
-
Section 39: More Visualization Practice
-
Section 40: R for Experimentation
-
Section 41: R for Genomics and Bioinformatics Deep Dive
-
Section 42: R for Marketing Analytics
-
Section 43: R Data Import/Export Deep Dive
-
Section 44: R String Processing Deep Dive
-
Section 45: R for Actuarial and Insurance Analytics
-
Section 46: R Testing and Quality Assurance Deep Dive
-
Section 47: R Version Control and Collaboration
-
Section 48: R Advanced Functional Programming
-
Section 49: R for Supply Chain and Operations
-
Section 50: More Practice Exercises Round 3
-
Section 51: R Dashboards and BI Integration
-
Section 52: R Data Governance and Ethics
-
Section 53: More Modeling Practice
-
Section 54: R Final Capstone Projects
-
Section 55: R for Sports Analytics
-
Section 56: More Interview Practice Round 2
-
Section 57: R Networking and APIs
-
Section 58: R for Environmental Science
-
Section 59: R Notebook and Documentation Practices
-
Section 60: More Data Wrangling Mastery
-
Section 61: R for A/B Testing at Scale
-
Section 62: R Package Ecosystem Deep Dive
1: Installing R and RStudio
Wait, why do I have to install two different things?
This is the first thing everyone asks. It's confusing because you'll see "R" and "RStudio" everywhere. Here is the simplest way to think about it: R is the engine, and RStudio is the dashboard. R is the actual programming language that does the heavy lifting—the math, the data manipulation, and the plotting. But if you open R by itself, you're looking at a very basic, somewhat clunky terminal window. It's functional, but it's not where you want to spend eight hours a day.
RStudio is an Integrated Development Environment (IDE). It's basically a fancy wrapper that makes R usable. It gives you a place to write your scripts, a window to see your variables, and a way to view your plots without hunting through folders. You must install R first, or RStudio will have no engine to run. I've seen a few juniors try to install just the IDE and then wonder why they can't run a single line of code. Don't be that person.
Where do I actually go to download these?
You want the official sources. For R, you head to CRAN (The Comprehensive R Archive Network). It looks like a website from 1998, but that's just the R aesthetic—trust me, it's the right place. Pick the version for your OS (Windows, Mac, or Linux) and go for the "base" install.
Once that's finished, head over to the Posit website (the company that makes RStudio) and download the free RStudio Desktop version. I usually recommend the latest stable release. If you're on a Mac with an M1 or M2 chip, just make sure you're downloading the ARM64 version if available, otherwise, it'll run through Rosetta and feel a bit sluggish.
How do I know if I actually installed it correctly?
Once you've got both installed, open RStudio (not the R app). You'll see a window split into several panes. The most important one right now is the Console—usually the bottom-left area. This is where the code actually executes.
To make sure everything is talking to each other, type this into the console and hit Enter:
getRversion()
If it spits back a version number (like "4.3.1"), you're golden. If you want to be extra sure the math engine is humming, try a quick calculation using a vector. Type this in:
sum(c(10, 20, 30, 40))
If you see 100, your environment is healthy and you're ready to actually start coding.
What's the difference between the Console and the Script editor?
I see people make this mistake constantly: they write their entire project directly into the Console. Don't do that. The Console is for "scratchpad" work—quick questions you want to ask R right now. But the moment you hit Enter, that code is "gone" in the sense that it's not saved in a file.
To write a program you can actually share or run tomorrow, go to File > New File > R Script. This opens a text editor in the top-left pane. You write your code there, and when you're ready to run a line, you hit Ctrl+Enter (or Cmd+Enter on Mac). This sends the code from your script down into the console. It's a much better workflow because it lets you iterate without re-typing everything from scratch.
📋 Practical Task
The RStudio Smoke Test
Now it's your turn to verify your environment is fully operational. Perform the following steps in RStudio:
- Create a new R Script (
File > New File > R Script). - In the script editor, write a line of code that creates a numeric vector of five numbers and calculates their mean using the
mean()function. - Run that line of code using the keyboard shortcut (
Ctrl/Cmd + Enter). - In the Console, run
sessionInfo()to see the details of your current R session.
Goal: You should see the calculated average in your console and a detailed list of your system's R version and platform info.
There are no comments for now.