turtlesOwn: New 'turtles' variable

turtlesOwnR Documentation

New turtles variable

Description

Create a new variable for the turtles.

Usage

turtlesOwn(turtles, tVar, tVal)

## S4 method for signature 'agentMatrix,character,missing'
turtlesOwn(turtles, tVar)

## S4 method for signature 'agentMatrix,character,ANY'
turtlesOwn(turtles, tVar, tVal)

Arguments

turtles

AgentMatrix object representing the moving agents.

tVar

Character. the name of the turtles variable to create.

tVal

Vector representing the values of tVar. Must be of length 1 or of length turtles. If missing, NA is given.

Value

AgentMatrix representing the turtles with the new variable tVar added.

Author(s)

Sarah Bauduin

References

Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.

See Also

https://ccl.northwestern.edu/netlogo/docs/dictionary.html#turtles-own

Examples

t1 <- createTurtles(n = 5, coords = cbind(xcor = 0, ycor = 0))
t1 <- turtlesOwn(turtles = t1, tVar = "sex", tVal = c("F", "F", "F", "M", "M"))


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