# Example 3: Point pattern analysis with NetLogo agents

### see NetLogo code fragments here

Figure 2. Using R functions "Lest" and "envelope" from the package "spatstat" to calculate the L-function (based on Ripley's K) with confidence envelopes of three different point patterns (spatial distributions of turtles in a NetLogo model). On the left the analyzed point patterns are shown, on the right side the plots of the corresponding L-functions (values of L(r) vs. different radii r). The L-function was calculated using R and plotted with NetLogo. The area between the dark gray lines marks the 98% confidence envelope of the L-function under complete spatial randomness (CSR) calculated from 99 Monte-Carlo-Simulations; the light gray line shows the theoretical L-function under CSR; the black line shows the L function for the observed pattern. (A): turtles are distributed randomly in space using uniformly distributed random values; (B): the values of the L-function for the spatial distribution of the turtles do not deviate from the envelope of the CSR at almost all distances (r), i.e. there is no significant deviation from CSR ; (C): nearly regular distribution of turtles; (D): there are significant differences to CSR with a tendency to regularity (obs < theo) especially at short distances, whereby the steps of the function values correspond to the horizontal, vertical and diagonal distances between the turtles; (E): turtles are clustered; (F): the black line (obs) shows a significant deviation from the CSR envelope with a tendency to aggregation (obs > theo) over all radii.