GitHunt
SA

samuelbharti/r-for-beginners

Learn R programming with interactive lessons and slides using the Gapminder dataset-designed for workshops and self-paced learning.

R for Novices - Gapminder Lessons

An adapted version of Software Carpentry's R-novice-gapminder course, designed to provide a clearer, more focused learning experience for both instructors and students.

๐ŸŒ View the lessons online

About This Course

This website presents R programming lessons in a decluttered, streamlined format that makes learning easier and more enjoyable. Whether you're an instructor teaching a workshop or a student learning independently, these lessons provide:

  • Clear, focused content without unnecessary complexity
  • Step-by-step examples using real-world data (Gapminder dataset)
  • Hands-on exercises to practice your skills
  • A clean, modern interface for easy navigation

Lessons

  1. Intro to R - Get oriented with R and RStudio (Page, Slides)
  2. Projects - Organize your work with projects (Page, Slides)
  3. Seeking Help - Learn to find and use help effectively (Page, Slides)
  4. Data Structures - Understand vectors, lists, and data frames (Page, Slides)
  5. Exploring Data Frames - Explore and inspect data frames in R (Page, Slides)
  6. Subsetting Data - Extract subsets of data with base R (Page, Slides)
  7. Control Flow - Use conditionals and loops (Page, Slides)
  8. ggplot2 - Create clear and effective graphics (Page, Slides)
  9. Vectorization - Write faster, cleaner code (Page, Slides)
  10. Functions - Build and use your own functions (Page, Slides)
  11. Writing Data - Export and save your data (Page, Slides)
  12. dplyr - Wrangle data with verbs and pipes (Page, Slides)
  13. R Markdown - Create reports with code and text (Page, Slides)
  14. Writing Good Software - Write readable, maintainable code (Page, Slides)

About These Lessons

These materials are designed as a supplementary resource for R programming workshops and independent learning. Whether you're an instructor teaching a workshop or a student learning on your own, you'll find:

  • Web pages - Perfect for reading and reference
  • Slides - Great for following along during live instruction

Use whichever format works best for your learning style!

About Quarto & the Slides

This whole site is built with Quarto - an open-source publishing system that turns plain text into websites, slides, PDFs, and more. Think of it as a modern, flexible way to write and share content without needing separate tools for each format.

The slide decks use Quarto's reveal.js format, and they're honestly pretty cool:

  • Navigate horizontally through main topics or vertically through sub-topics
  • Press F to go full screen
  • Press S to open speaker/presentation mode (with notes and a timer)
  • Hit E to switch to a PDF-friendly view, then print or save as PDF
  • Built-in chalkboard to draw on slides during a live session

It's an excellent setup for teaching - everything lives in one place, looks clean, and just works in the browser. No PowerPoint needed.

Who Is This For?

  • Instructors: Use these materials for teaching R programming workshops
  • Students: Follow along during class or work through lessons independently
  • Self-learners: Build your R programming skills at your own pace

Getting Started

No installation required! Simply visit the website and start learning.

To follow along with the lessons, you'll need:

  • R (version 4.0 or higher)
  • RStudio (recommended)
  • The gapminder package: install.packages("gapminder")

Credits

License

This work is licensed under CC BY 4.0, following Software Carpentry's licensing. You are free to share and adapt these materials with attribution.


For Developers

Quick notes for contributors:

  • Source lessons live in lessons/ and slides/.
  • Lesson pages render to docs/lessons and slide decks render to docs/slides.
  • The slide assets in docs/slides/site_libs must be committed for GitHub Pages.

Project Structure

โ”œโ”€โ”€ index.qmd              # Homepage (renders to docs/index.html)
โ”œโ”€โ”€ lessons/               # Lesson source files (.qmd)
โ”‚   โ””โ”€โ”€ exploring_dataframes.qmd
โ”œโ”€โ”€ docs/                  # Generated website (for GitHub Pages)
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ””โ”€โ”€ lessons/
โ”‚       โ””โ”€โ”€ exploring_dataframes.html
โ””โ”€โ”€ _quarto.yml           # Website configuration

Build the Website

Render the lesson pages:

quarto render

Then render the slides:

cd slides
quarto render
cd ..

Or do both in one go:

# Bash
quarto render && cd slides && quarto render && cd ..
# PowerShell
quarto render; Push-Location slides; quarto render; Pop-Location

Deploy to GitHub Pages

  1. Build the site: quarto render
  2. Push to GitHub:
    git add .
    git commit -m "Update website"
    git push origin main
  3. Enable GitHub Pages:
    • Go to repository Settings > Pages
    • Source: main branch
    • Folder: /docs
    • Save

Your site will be at: https://samuelbharti.github.io/r-for-beginners/

Add More Lessons

  1. Create new .qmd file in lessons/ directory
  2. Add to navbar in _quarto.yml
  3. Run quarto render
samuelbharti/r-for-beginners | GitHunt