The **metafor** package in R provides comprehensive functions for conducting meta-analyses, including fitting fixed- and random-effects models, meta-regression analyses, and handling 2 × 2 table data. It supports various outcome measures such as log relative risk, odds ratio, risk difference, and standardized mean differences. The package includes functions for calculating effect sizes, assessing model fit, obtaining case diagnostics, and testing publication bias. The article introduces the package, explains the different model types, and provides examples of how to use the functions for data analysis, model fitting, and visualization. It also discusses the Knapp and Hartung adjustment for more accurate inference in random- and mixed-effects models.The **metafor** package in R provides comprehensive functions for conducting meta-analyses, including fitting fixed- and random-effects models, meta-regression analyses, and handling 2 × 2 table data. It supports various outcome measures such as log relative risk, odds ratio, risk difference, and standardized mean differences. The package includes functions for calculating effect sizes, assessing model fit, obtaining case diagnostics, and testing publication bias. The article introduces the package, explains the different model types, and provides examples of how to use the functions for data analysis, model fitting, and visualization. It also discusses the Knapp and Hartung adjustment for more accurate inference in random- and mixed-effects models.