randomXcor: Random 'xcor'

randomXcorR Documentation

Random xcor

Description

Report n random xcor coordinates within the world's extent.

Usage

randomXcor(world, n)

## S4 method for signature 'worldNLR,numeric'
randomXcor(world, n)

Arguments

world

WorldMatrix or worldArray object.

n

Integer.

Value

Numeric. Vector of length n of xcor coordinates.

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#random-cor

Examples

w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4,
                          data = runif(25))
t1 <- createTurtles(n = 10, coords = cbind(xcor = randomXcor(world = w1, n = 10),
                                           ycor = randomYcor(world = w1, n = 10)))
plot(w1)
points(t1, col = of(agents = t1, var = "color"), pch = 16)



NetLogoR documentation built on Aug. 17, 2022, 9:06 a.m.