Data Handling and Analysis in Macroecology

Tools for handling, processing, and analyzing species geographic distributions, environmental data, and biodiversity patterns across geographical, environmental, and attribute spaces. Includes functions for constructing and analyzing species distributions, estimating geographic ranges from occurrence records, and conducting spatial analyses in macroecology. See Vilela and Villalobos (2015) and Vilela et al. (2026) for details.


letsR letsR website

R-CMD-check CRAN_Status_Badge CRAN downloads Total CRAN downloads codecov

The package

The letsR package is being developed to help researchers handle, process, and analyze macroecological data. It aims to integrate these methodological processes into a single software platform for macroecological analyses. The package's main functions allow users to build presence-absence matrices, the primary analytical tool in macroecology, from species' geographical distributions and merge them with species' traits, conservation information and spatial environmental layers. In addition, other packages' functions enable users to summarize and visualize data from presence-absence matrices.

All functions in this package use a prefix and a suffix separated by a dot; the prefix refers to the package's name, and the suffix to the actual function. This nomenclature avoids confusion with potentially similarly-named functions from other R packages. For instance, the letsR function used to create presence-absence matrices is called lets.presab (but see also lets.presab.birds and lets.presab.points), whereas the one used to add variables to a presence-absence matrix is called lets.addvar.
The package's primary functions create and work on a particular S3 object class called PresenceAbsence. Such PresenceAbsence object class allows storing information beyond presence-absence data (e.g. user-defined grid-cell system) and using the generic plot, summary and print functions of R. Also, some package's functions allow the user to input customary R objects (e.g. vector, matrix, data.frame).

The letsR package is in continuous development, and suggestions are more than welcome!

We hope you enjoy it and find it helpful.

Package publication

https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.12401

Install

Install letsR from CRAN

install.packages("letsR")
library("letsR")

Install letsR developers version from github

install.packages("devtools")
library(devtools)
install_github("macroecology/letsR")
library(letsR)

OBS.: To download the developers version you will need to have the git software installed (https://git-scm.com/). If you are a windows user you will also need to download the Rtools (https://cran.r-project.org/bin/windows/Rtools/).

Documentation guide and annotated vignette index

The vignettes below provide a suggested pathway through the main letsR workflows. New users should begin by creating a presence-absence matrix and then proceed to the sections most relevant to their data and research questions.

Create and manage presence-absence matrices

Analyze biodiversity patterns

Work across geographic, environmental, and attribute spaces

For documentation on individual functions and their arguments, consult the function reference.

Note

Due to changes in the IUCN API and limitations in data distribution established by IUCN terms of use, we are no longer maintaining the functions lets.iucn, lets.iucn.hist and lets.iucn.ha. These functions will be removed from the package in the next version. We apologize for any inconvenience this may cause.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("letsR")

6.1 by Bruno Vilela, 3 days ago


https://doi.org/10.1111/2041-210X.12401, https://doi.org/10.1111/2041-210X.70421, https://github.com/macroecology/letsR, https://brunovilela.github.io/letsR/


Report a bug at https://github.com/macroecology/letsR/issues


Browse source code at https://github.com/cran/letsR


Authors: Bruno Vilela [aut, cre] (ORCID: , Bruna M. Farina [ctb] , Ricardo Dobrovolski [ctb] (ORCID: , Sidney F. Gouveia [ctb] (ORCID: , José Alexandre F. Diniz-Filho [ctb] (ORCID: , Thiago F. Rangel [ctb] , Trevor S. Fristoe [ctb] (ORCID: , Carlos Calderón del Cid [ctb] (ORCID: , Marco Túlio Pacheco Coelho [ctb] (ORCID: , Catherine H. Graham [ctb] (ORCID: , Fabricio Villalobos [aut] (ORCID:


Documentation:   PDF Manual  


GPL-2 license


Imports dbscan, geosphere, sf

Depends on terra, grDevices, graphics, methods, stats

Suggests testthat, devtools, knitr, rmarkdown, dplyr, kableExtra, ggplot2, rnaturalearth

System requirements: GEOS (>= 3.11.0) for lets.range()


Suggested by VasGBIF.


See at CRAN