Learn R Programming

⚠️There's a newer version (2.0.6) of this package.Take me there.

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

1.0.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Alex M Chubaty

Last Published

January 5th, 2023

Functions in SpaDES.tools (1.0.1)

.pointDistance

Alternative point distance (and direction) calculations
move

Move
fastCrop

fastCrop is a wrapper around velox::VeloxRaster_crop, though raster::crop is faster under many tests.
inRange

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

Rcpp Sugar version of runif
duplicatedInt

Rcpp duplicated on integers using Rcpp Sugar
resample

spread2

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

Internal helpers
distanceFromEachPoint

Calculate distances and directions between many points and many grid cells
.matchedPointDirection

Calculate matched point directions
initiateAgents

SELES - Initiate agents
middlePixel

Return the (approximate) middle pixel on a raster
probInit

SELES - Probability of Initiation
numAgents

SELES - Number of Agents to initiate
agentLocation

SELES - Agent Location at initiation
rasterizeReduced

Convert reduced representation to full raster
randomStudyArea

Create default study areas for use with SpaDES modules
transitions

SELES - Transitioning to next time step
.findFactors

Find factors
dwrpnorm2

Vectorized wrapped normal density function
sampleV

Resample
patchSize

Patch size
rings

Identifies all cells within a ring around the focal cells
neutralLandscapeMap

Produce a neutral landscape using a midpoint displacement algorithm
gaussMap

Produce a raster of a random Gaussian process.
randomPolygons

Produce a RasterLayer of random polygons
.pkgEnv

The SpaDES.tools package environment
heading

Heading between spatial points.
testEquivalentMetadata

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

An alternative spread function, conceived for insects
mergeRaster

Split and re-merge RasterLayer(s)
specificNumPerPatch

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

Identify outward radiating spokes from initial points
spread

Simulate a spread process on a landscape.
wrap

Wrap coordinates or pixels in a torus-like fashion
adj

Fast adjacent function, and Just In Time compiled version
cir

Identify pixels in a circle or ring (donut) around an object.
SpaDES.tools-package

Categorized overview of the SpaDES.tools package
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.
directionFromEachPoint

Calculate distances and directions between many points and many grid cells