Chapter 3: R Get Started

R Get Started” — this is the hands-on, step-by-step guide where we actually install everything, open it for the first time, run your very first lines, and make sure nothing goes wrong.

I’m explaining this like your personal offline teacher in Secunderabad — slow, detailed, with screenshots-in-words, common mistakes Indian beginners make, and lots of copy-paste examples you can try immediately.

Step 1: Understand What You Actually Need (2026 Reality)

To use R today you need two separate things:

  1. R itself — the engine/language (free, from CRAN) Current stable version (as of February 2026): R 4.5.2 (released late 2025, patched February 2026)
  2. RStudio — the best editor/IDE (free Desktop version from Posit) Current stable series (February 2026): 2026.01 “Apple Blossom” or the latest patch

You must install R first, then RStudio (RStudio needs R to run).

Step 2: Download & Install R (Windows — most common in India)

  1. Open your browser → go to official site: https://www.r-project.org/ (or directly https://cran.r-project.org/)

  2. Click “Download R for Windows” (under “Download R”)

  3. Click “base” sub-directory

  4. You should see something like: Download R 4.5.2 for Windows (or 4.5.3 patched if newer by now) → Click that link → it downloads an .exe file (~80–100 MB)

  5. Run the downloaded file (R-4.5.2-win.exe or similar)

    • Language → English (or any)
    • Accept defaults almost everywhere
    • Important choices:
      • Destination location → usually C:\Program Files\R\R-4.5.2 (this becomes your R_HOME)
      • Start Menu folder → yes
      • Select additional tasks → check:
        • Create a desktop icon
        • Save version number in registry (recommended)
        • Associate .RData & .R files with R (optional but useful)
  6. Finish installation → it takes 1–2 minutes.

  7. Quick test: Double-click the new R x64 desktop icon (or search “R” in Start menu). A plain black/white console opens saying:

    text

    Type R.version.string and press Enter → should show your version.

    Close it — we won’t use plain R much; RStudio is way better.

Common mistake in India: Downloading from unofficial sites or old mirrors → always use cran.r-project.org directly.

Step 3: Download & Install RStudio Desktop (Free)

  1. Go to: https://posit.co/download/rstudio-desktop/

  2. Scroll down → under RStudio Desktop → click Download RStudio Desktop

  3. It auto-detects Windows → downloads RStudio-2026.01.x-windows.exe (~200–300 MB)

  4. Run the installer:

    • Accept license
    • Install for all users (recommended)
    • Destination → default is fine
    • Add shortcut to desktop & Start menu → yes
  5. Finish → launch RStudio.

First time you open RStudio:

You see 4 panes:

  • Top-left : Source / Script editor (empty or welcome page)
  • Bottom-left : Console (this is where R actually runs — looks like plain R)
  • Top-right : Environment / History / Connections
  • Bottom-right : Files / Plots / Packages / Help / Viewer

If Console shows red error like “R not found”, it means RStudio can’t find your R installation → restart computer or manually set it (rare).

Step 4: Your Very First “Get Started” Session in RStudio (Do This Now!)

  1. Create your first script File → New File → R Script (or Ctrl+Shift+N)
  2. Paste these lines into the script pane (top-left):
R
  1. Run it:

    • Highlight all lines → Ctrl+Enter (or click Run button)
    • Or run line-by-line with Ctrl+Enter on each line

    You should see output in Console (bottom-left):

    text
  2. Bonus: Quick plot

    Add this at the end and run:

R

A simple line plot appears in Plots pane (bottom-right)!

Step 5: Essential First Settings & Tips (Save Yourself Headaches)

  • Set working directory (where your files save): Session → Set Working Directory → Choose Directory… → pick a folder like D:\R_Projects
  • Install your first package (ggplot2 — magic plots):
R
  • Update R & packages later: In console: update.packages(ask = FALSE)
  • Cheat sheets (download & keep): https://posit.co/resources/cheatsheets/ → ggplot2, dplyr, base R

Step 6: What Next After “Get Started”?

You now have a working setup! 🎯

Suggested 7-day plan:

  • Day 1: Play with vectors, data.frame (like Excel table)
  • Day 2: Import CSV (your own marks/expenses file)
  • Day 3: dplyr basics (filter, select, mutate)
  • Day 4: First ggplot2 plots
  • Day 5: Basic stats (mean, sd, t.test)
  • Day 6–7: R Markdown — make a beautiful report

Free best starting resources (2026):

  • Posit “Get Started” → https://docs.posit.co/ide/user/ide/get-started/
  • Official “An Introduction to R” PDF → https://cran.r-project.org/doc/manuals/r-release/R-intro.pdf
  • DataCamp free “Introduction to R” course
  • Book: R for Data Science (2nd edition, free online) → https://r4ds.hadley.nz

Feeling stuck somewhere?

  • Installation error?
  • Want to import your first real file?
  • Mini-project with IPL scores or monthly budget?

Just tell me — we’ll fix it together right now. You’re officially started! 🚀 Keep going!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *