Overview
Welcome to the beginner level of R programming! This section covers the fundamentals you need to get started with R.
Learning Objectives
By the end of this section, you will be able to: - Understand R basics and the RStudio environment - Work with different data types (vectors, lists, matrices, data frames, factors) - Use control structures (if/else, loops, functions) - Read and write data files - Write basic R programs
Prerequisites
- R and RStudio installed on your computer
- Basic computer literacy
- No prior programming experience required!
Course Materials
1. Introduction to R
File: 01-introduction.Rmd
- What is R and why use it?
- RStudio interface overview
- Basic operations and calculations
- Getting help in R
- Variables and assignment
2. Data Types and Structures
File: 02-data-types.Rmd
- Vectors (numeric, character, logical)
- Lists
- Matrices
- Data frames
- Factors
- Indexing and subsetting
3. Control Structures
File: 03-control-structures.R
- If/else statements
- For loops
- While loops
- Functions
- Apply family functions
4. Data Input/Output
File: 04-data-input-output.R
- Reading CSV files
- Writing CSV files
- Working with Excel files
- Importing other file types
Exercises
Complete the exercises in exercises/beginner-exercises.R to practice what you've learned.
Solutions are provided in solutions/beginner-solutions.R, but try to solve them yourself first!
How to Use This Section
- Start with
01-introduction.Rmdin RStudio - Follow along with the examples
- Run all code snippets to see the output
- Complete exercises after each lesson
- Check solutions when stuck
Estimated Time
- Week 1: Introduction and Data Types (8 hours)
- Week 2: Control Structures and I/O (8 hours)
- Week 3: Exercises and Review (8 hours)
Total: 24 hours
Tips for Success
- Run every code example yourself
- Experiment with modifying the code
- Don't just read - actively practice
- Use R's help function:
?function_name - Save your work frequently
- Ask questions when you encounter errors
Next Steps
Once you've completed all beginner materials and exercises, you're ready for the Intermediate Level!