turtles2sf: From 'agentMatrix' to 'sf'

turtles2sfR Documentation

From agentMatrix to sf

Description

Convert an agentMatrix object into an sf object.

Usage

turtles2sf(turtles)

## S4 method for signature 'ANY'
turtles2sf(turtles)

Arguments

turtles

AgentMatrix object representing the moving agents.

Value

sf object of ⁠POINT geometry⁠ 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("sf", quietly = TRUE)) {
  sf_t1 <- turtles2sf(turtles = t1)
}


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