Report the coordinates of the patches
under the turtles
locations.
patchHere(world, turtles)
# S4 method for worldNLR,agentMatrix
patchHere(world, turtles)
WorldMatrix
or worldArray
object.
AgentMatrix
object representing the moving agents
.
Matrix (ncol
= 2) with the first column pxcor
and the second column
pycor
representing the coordinates of the patches
at the turtles
location. The order of the patches
follows the order of the turtles
.
If a turtle
is located outside of the world
's extent,
NA
are returned
for the patch
coordinates.
Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9)
t1 <- createTurtles(n = 10, coords = randomXYcor(w1, n = 10))
patchHere(world = w1, turtles = t1)
#> pxcor pycor
#> [1,] 8 3
#> [2,] 8 6
#> [3,] 6 3
#> [4,] 5 8
#> [5,] 0 1
#> [6,] 0 2
#> [7,] 9 2
#> [8,] 2 2
#> [9,] 7 9
#> [10,] 0 8