turtles2spdf: From 'agentMatrix' to 'SpatialPointsDataFrame'

turtles2spdfR Documentation

From agentMatrix to SpatialPointsDataFrame

Description

Convert an agentMatrix object into a SpatialPointsDataFrame object.

Usage

turtles2spdf(turtles)

## S4 method for signature 'agentMatrix'
turtles2spdf(turtles)

Arguments

turtles

AgentMatrix object representing the moving agents.

Value

SpatialPointsDataFrame object representing the moving agents (coordinates and data) as contained in turtles.

Author(s)

Sarah Bauduin

Examples

t1 <- createTurtles(n = 10, coords = cbind(xcor = 1:10, ycor = 1:10))
if (requireNamespace("sp", quietly = TRUE)) {
  sp1 <- turtles2spdf(turtles = t1)
}


PredictiveEcology/NetLogoR documentation built on Jan. 31, 2024, 9:31 p.m.