Intro to R & MAd
The Computational Workbench
R: The Language of Modern Science
R is not just a calculator. It is a vector-based language designed specifically for data analysis. Unlike Excel, every step in R is self-documenting and reproducible.
1. Vectors and Object Orientation
In R, everything is an object. And almost everything is a vector.
The c() Function
The most fundamental function in R is c() (combine/concatenate). It creates vectors.
Try creating a vector of effect sizes.
R is “vectorized”. This is its superpower. You can do math on the entire list at once.
2. Logical Indexing (The SQL of R)
How do we query data? We use square brackets [] and logical conditions.
3. Dataframes: The Excel Sheet
Vectors are powerful, but we usually work with Dataframes (tables).
4. Visualizing Data
R’s hist() and plot() functions give you instant visual feedback.
5. The MAd Package
Now let’s use a real meta-analysis package. MAd (Meta-Analysis with Mean Differences) is designed to handle effect size aggregation.