Learn R Programming

NetLogoR (version 0.3.9)

turtles2spdf: From agentMatrix to SpatialPointsDataFrame

Description

Convert an agentMatrix object into a SpatialPointsDataFrame object.

Usage

turtles2spdf(turtles)

# S4 method for 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.

Examples

Run this code
# NOT RUN {
t1 <- createTurtles(n = 10, coords = cbind(xcor = 1:10, ycor = 1:10))
sp1 <- turtles2spdf(turtles = t1)


# }

Run the code above in your browser using DataLab