Learn R Programming

SpaDES.tools

Additional modelling tools for Spatial Discrete Event Simulation (SpaDES) module development.

Provides GIS/map utilities and additional modeling tools for developing cellular automata and agent based models in SpaDES.

Website: https://SpaDES.PredictiveEcology.org

Wiki: https://github.com/PredictiveEcology/SpaDES/wiki

Installation

Building packages from source requires the appropriate development libraries for your operating system (e.g., Windows users should install Rtools).

Current stable release

Install from CRAN:

install.packages("SpaDES.tools")

Install from GitHub:

#install.packages("devtools")
library("devtools")
install_github("PredictiveEcology/SpaDES.tools", dependencies = TRUE) # master

Development version (unstable)

Install from GitHub:

#install.packages("devtools")
library("devtools")
install_github("PredictiveEcology/SpaDES.tools", ref = "development", dependencies = TRUE)

Contributions

Please see CONTRIBUTING.md for information on how to contribute to this project.

Copy Link

Version

Install

install.packages('SpaDES.tools')

Monthly Downloads

901

Version

2.0.9

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Alex M Chubaty

Last Published

October 14th, 2025

Functions in SpaDES.tools (2.0.9)

resample

randomPolygons

Produce a SpatRaster of random polygons
middlePixel

Return the (approximate) middle pixel on a raster
rasterizeReduced

Convert reduced representation to full raster
.pkgEnv

The SpaDES.tools package environment
.matchedPointDirection

Calculate matched point directions
specificNumPerPatch

Initiate a specific number of agents in a map of patches
testEquivalentMetadata

Test that metadata of 2 or more objects is the same
spread

Simulate a spread process on a landscape.
mergeRaster

Split and re-merge RasterLayer(s)
spread3

An alternative spread function, conceived for insects
rings

Identifies all cells within a ring around the focal cells
spread2

Simulate a contagious spread process on a landscape, with data.table internals
sampleV

Resample
spokes

Identify outward radiating spokes from initial points
wrap

Wrap coordinates or pixels in a torus-like fashion
rbindlistDtDtpot

Internal helpers
cirSpecialQuick

This is a very fast version of cir with allowOverlap = TRUE, allowDuplicates = FALSE, returnIndices = TRUE, returnDistances = TRUE, and includeBehavior = "excludePixels". It is used inside spread2, when asymmetry is active. The basic algorithm is to run cir just once, then add to the x,y coordinates of every locus.
transitions

SELES - Transitioning to next time step
numAgents

SELES - Number of Agents to initiate
cir

Identify pixels in a circle or ring (doughnut) around an object.
agentLocation

SELES - Agent Location at initiation
probInit

SELES - Probability of Initiation
move

Move
fastCrop

fastCrop is deprecated.
adj

Fast adjacent function, and Just In Time compiled version
SpaDES.tools-package

Categorized overview of the SpaDES.tools package
dwrpnorm2

Vectorized wrapped normal density function
directionFromEachPoint

Calculate distances and directions between many points and many grid cells
distanceFromEachPoint

Calculate distances and directions between many points and many grid cells
heading

Heading between spatial points.
gaussMap

Produce a raster of a random Gaussian process.
inRange

Test whether a number lies within range [a,b]
initiateAgents

SELES - Initiate agents
.pointDistance

Alternative point distance (and direction) calculations
.findFactors

Find factors
duplicatedInt

Rcpp duplicated on integers using Rcpp Sugar
randomStudyArea

Create default study areas for use with SpaDES modules
runifC

Rcpp Sugar version of runif
patchSize

Patch size
neutralLandscapeMap

Produce a neutral landscape using a midpoint displacement algorithm