About This Book

About the Author

Jimmy Moses is a Papua New Guinean entomologist and lecturer at the Papua New Guinea University of Technology’s School of Forestry, specializing in ant ecology, biostatistics, and geospatial analysis. He holds a Ph.D. in Entomology from the University of South Bohemia (2021) and has extensive experience in tropical ecology research, with a particular focus on ant communities along elevational gradients.

As an active researcher and educator, the author currently supervises several master’s students and co-supervises a Ph.D. student, bringing substantial expertise to both research methodology and educational practices. His research combines ecological field studies with modern analytical approaches, bridging the gap between traditional field ecology and contemporary data science. This interdisciplinary approach has resulted in several publications in high-impact journals, including Global Ecology and Biogeography and Proceedings of the Royal Society B.

The author possesses a diverse technical skillset that uniquely qualifies him to author this book:

  • Advanced proficiency in R and Python for statistical computing and data science
  • Expert knowledge of GIS and satellite remote sensing for spatial data analysis
  • Strong foundation in biostatistics and experimental design applied to ecological research
  • Developing expertise in full-stack application development for scientific computing

His international research collaborations span institutions in the Czech Republic, Germany, and Belgium. He has been an integral contributor to the New Guinea Binatang Research Center, supporting both research initiatives and educational programs in Papua New Guinea.

When not teaching or conducting research, the author enjoys reading across disciplines—from technical manuals to ecological texts—and experimenting with code to solve practical problems in data analysis. His passion for making complex analytical methods accessible to researchers in the natural sciences drives both his teaching and his writing, including this book.

Purpose and Scope

This book is designed to serve as both a learning resource and a reference guide for data analysis in the natural sciences, with applications spanning forestry, agriculture, ecology, environmental science, marine biology, and related disciplines. Whether you’re a student, researcher, technician, professional, or hobbyist in these fields, this book will help you develop the skills needed to analyze and visualize data effectively using R.

The focus is on practical applications rather than theoretical statistics, with an emphasis on techniques commonly used across natural science disciplines. By working through this book, you will:

  • Master the fundamentals of data analysis in R
  • Learn to import, clean, and organize various types of scientific data
  • Develop skills in exploratory data analysis and visualization
  • Apply appropriate statistical tests for different research questions
  • Create publication-quality visualizations
  • Implement reproducible research workflows
  • Interpret and communicate results effectively

Features of This Book

This book includes:

  • Step-by-step instructions for R with complete code examples
  • Practical examples using real datasets from various natural science disciplines
  • Exercises to reinforce learning and build skills
  • Tips and best practices from experienced researchers
  • Reproducible code that can be adapted for your own research
  • Professional formatting of data and model outputs

Professional Data and Model Output Formatting

Throughout this book, we use several R packages to create professionally formatted tables and model outputs suitable for publications:

  • knitr: The core package for dynamic report generation, allowing seamless integration of R code with text
  • kableExtra: For creating elegant, publication-quality tables with customizable styling
  • gt: For producing beautiful, highly customizable tables with advanced formatting options
  • broom: For converting statistical model outputs into tidy data frames that are easier to work with
  • sjPlot: For creating publication-ready tables and plots from statistical models
  • gtsummary: For creating publication-ready analytical and summary tables
  • flextable: For creating tables that work well across different output formats (HTML, PDF, Word)

These tools help transform raw data and complex statistical outputs into clear, professional presentations. Each chapter demonstrates how to use these packages to format your results effectively, following best practices in scientific publishing. You’ll learn to:

  • Format regression tables with proper statistical notation
  • Create elegant summary tables with appropriate precision and units
  • Generate publication-ready ANOVA tables
  • Design custom table themes that match your publication requirements
  • Export formatted tables to various formats (HTML, PDF, Word)

The code examples throughout the book show not just how to perform analyses, but how to present the results professionally—a critical skill for scientific communication.

How to Use the Code Examples

All code examples in this book are written in R and can be executed in RStudio. To use the examples:

  1. Make sure you have R and RStudio installed (see Chapter 1 for installation instructions)
  2. Install the required packages mentioned at the beginning of each chapter
  3. Copy and paste the code into your R console or script editor
  4. Modify the code as needed for your own data

The datasets used in the examples are available in the docs/data directory of the book’s repository and are properly cited throughout the text.

Software Requirements

This book uses:

  • R (version 4.0.0 or higher)
  • RStudio (latest version recommended)
  • Various R packages (installation instructions provided in each chapter)

Feedback and Contributions

Your feedback is valuable for improving future editions of this book. If you find errors, have suggestions, or want to contribute examples, please submit them through the book’s repository or contact the author directly.

Acknowledgments

I would like to express my gratitude to colleagues, students, and the broader R community whose insights and feedback have contributed to the development of this book. Special thanks to the creators and maintainers of the R packages used throughout this book, as well as the data providers whose datasets make the examples both practical and relevant.

⚠️ DRAFT - EDITION 1 ⚠️ | This book is currently in development. Content is subject to change before final publication. | © 2025 Jimmy Moses