An Introductory Guide to R
Easing the Learning Curve
Eric L. Einspruch
- Purpose of This Book
- What You Will be Able to Do after Reading This Book
- Whom This Book Is For
- Approach
2. Getting Started
- Download and Install R
- Download and Install RStudio
- RStudio Fundamentals
- Download, Install, and Load R Packages
- Read Data into R
- Write Data Files
- Entering Data via Inline Code
- Cleaning Variable Names
- Clearing the Console
- Clearing the Environment
- Some Thoughts on Debugging R Code
3. Data Wrangling
- Example Data
- The Pipe
- Select Variables
- Select Cases
- Missing Data (Part I)
- Recode Variables
- Arithmetic and Logical Operators
- Missing Data (Part II)
- Identify and Change Variable Types
- Change Factor Value Labels
- Join Data Frames
- Aggregate (Summarize) Data
- Wide and Long Data Formats
4. Descriptive Statistics, t-Tests, One-Way ANOVA, and Chi-Square Test
- Descriptive Statistics
- t-Tests
- One-Way ANOVA
- Crosstabulation
5. Factorial ANOVA, Repeated-Measures ANOVA, Correlation, and Regression
- Factorial ANOVA
- Repeated-Measures ANOVA
- Correlation
- Regression
6. Data Visualization
- Layered Grammar of Graphics
- Bar Chart
- Boxplot
- Line Graph
- Scatterplot
- Regression Diagnostics
- Saving a Chart
7. R Markdown
- Markdown Template
- Working in Markdown
8. Functions
9. Next Steps
- Finding Help
- Learn More about R and R Programming
- Community
- Learn More about Statistics
- Updating R, R Packages, and RStudio
10. Conclusion
Appendix A. R Data Structures
Appendix B. Suggested Answers to Exercises
References
Index