Ecological Analyses in Julia
An introduction to ecological data science with Julia
Preface
This book is an introduction to ecological data analysis using the Julia language. It began as an answer to a simple question: how much of the ecologist’s toolkit already exists in Julia today, and how much still has to be built?
The idea for this book was inspired by the wonderful project Análises Ecológicas no R (Da Silva et al. 2022) by Silva, Gonçalves-Souza, Paterno, Provete and Vancine — an open, Portuguese-language book that became the entry point for a generation of Brazilian ecologists. This volume deliberately follows its structure, chapter by chapter, so the two can be read side by side.
Scope of this edition
This first edition runs from language basics through generalized linear models (chapters 1–9), with a chapter on exploratory data analysis before the models, followed by two chapters on programming for ecology: writing your own functions and resampling and simulation (chapters 10–11). The community-ecology chapters of the original book (Análises Ecológicas no R) — multivariate analysis, rarefaction, richness estimators, taxonomic, phylogenetic and functional diversity, and geospatial data — are not included.
That is not an oversight. In R those chapters use packages such as vegan, iNEXT, picante and FD. Julia has no mature equivalents today. Writing those chapters honestly means writing the packages first, and that is a separate project (and not one for me). See The honest cost for a detailed assessment.
This is not a small slice. They cover what most of an ecological analysis actually consumes: importing and cleaning data, visualizing it, fitting linear and generalized linear models, and handling hierarchical structure through mixed models. At every one of those points the Julia ecosystem is solid: the packages exist, they are maintained, and they do the job very well. Where this book compares Julia to R, the comparisons are limited to what can be checked — syntax, feature coverage, behaviour demonstrable in the code — and not to performance claims I do not measure here.
How to use this book
All code is executable and runs in the Julia environment defined by Project.toml. To reproduce the book locally:
git clone https://github.com/esantos2ua/EcologicalAnalysesInJulia.git
cd EcologicalAnalysesInJulia
julia --project=. scripts/setup.jl
quarto render enThroughout the text, boxes like this one translate from R’s idiom into Julia’s:
In R
dplyr::filter(data, height > 10) corresponds to @filter(data, height > 10) in TidierData.jl. The semantics are the same; the difference is that @filter is a macro rather than a function: code that rewrites your code before it runs (Naming conventions).
Relationship to Análises Ecológicas no R
This project is inspired by Análises Ecológicas no R (Da Silva et al. 2022), by Fernando Rodrigues da Silva, Thiago Gonçalves-Souza, Gustavo Brant Paterno, Diogo Borges Provete and Maurício Humberto Vancine, and owes it an explicit structural debt: this book’s chapter sequence deliberately follows theirs, so the two can be read side by side.
What this book does not do is reproduce the original’s content. The text, examples, dataset and exercises here are written from scratch for Julia. The authors of the original book have no involvement in this project, have not reviewed it, and do not endorse it; any errors here are mine.
Análises Ecológicas no R is freely available at https://analises-ecologicas.com/ under a CC BY-NC 4.0 licence, and in print from Nupeea and Canal 6 (2022, 640 pp., ISBN 978-85-7917-564-0). If this book is useful to you, the original will probably be more so.
Relationship to ecoR
Chapters 7, 10 and 11 do not come from Análises Ecológicas no R. They are inspired by the exploratory-analysis, programming and resampling modules of ecoR (Oliveira 2026), the R course wiki of the Instituto de Biociências, Universidade de São Paulo, produced and maintained by Alexandre Adalardo de Oliveira, and based in part on material by João Luis Ferreira Batista and Paulo Inácio K. L. Prado. As with the original book, the text, examples and exercises here are written from scratch; the authors of ecoR have not reviewed this book. Each of the three chapters opens with links to the corresponding ecoR material.
ecoR is freely available at https://ecor.ib.usp.br/ under a CC BY-SA 4.0 licence, with exercises graded automatically in notaR.
Bilingual edition
This book exists in English and Portuguese, built from the same repository. The Portuguese version is at /pt. The chapters are translations of one another, and the code is identical in both. I write mostly in Portuguese and use AI tools to translate the content into English, which I then review.
How to cite
Each version of the book is archived on Zenodo with a DOI. If you use this book, please cite it as:
Santos, E. (2026). Ecological Analyses in Julia (version 1.0.0). Zenodo. https://doi.org/10.5281/zenodo.23126524
Both editions, English and Portuguese, are part of the same record. The DOI above always resolves to the latest version. To cite exactly the version you read, use that version’s DOI, listed on the Zenodo page, and see the Change log.
In BibTeX:
@book{santos2026ecological,
author = {Santos, Eduardo},
title = {Ecological Analyses in Julia},
year = {2026},
version = {1.0.0},
publisher = {Zenodo},
doi = {10.5281/zenodo.23126524},
url = {https://doi.org/10.5281/zenodo.23126524}
}License
Text under CC BY-NC-SA 4.0; code under the MIT licence. Contributions, corrections and bug reports are welcome in the repository.