randomXYcor: Random 'turtles' coordinates

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
2
3
4
randomXYcor(world, n)

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

Arguments

world

WorldMatrix or worldArray object.

n

Integer.

Value

Matrix (ncol = 2, nrow = n) with the first column xcor and the second column ycor.

Author(s)

Sarah Bauduin

Examples

1
2
3
4
5
w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4,
                          data = runif(25))
t1 <- createTurtles(n = 10, coords = randomXYcor(world = w1, n = 10))
plot(w1)
points(t1, col = of(agents = t1, var = "color"), pch = 16)

NetLogoR documentation built on Oct. 19, 2021, 5:06 p.m.