1.

The two different ways I found to rewrite the command with different syntax are as follows:

poisson_plot <- rpoispp(500)
plot(poisson_plot)

rpoispp(500)|>
  plot()

2.

According to the ?contour help page, the ‘add’ argument adds to the current plot if set to true.

3.

The numbers within the squares refer to the amount of points present in each square; it is the density of points within the squares.

4.

Number of Points Number of Grid Cells P-Values P-Value Interpretation
500 400 0.01038 Below 0.05 threshold, reject the null
500 400 0.05973 Above the 0.05 threshold, do not reject the null
500 400 0.00437 Below the 0.05 threshold, reject the null

5.

P-Value P-Value Interpretation
0.03288 Below the 0.05 threshold, likely reject the null
0.8199 Very much above the 0.05 threshold, do not reject the null
0.1554 Above the 0.05 threshold, do not reject the null

6.

When experimenting with higher grid numbers, I received results with higher p-values on average, and when I tried lower grid numbers, I received lower p-values on average.

7.

As found in summary(lansing), the study area for the lansing data is 924 sq. ft.

summary(lansing)
## Marked planar point pattern:  2251 points
## Average intensity 2251 points per square unit (one unit = 924 feet)
## 
## *Pattern contains duplicated points*
## 
## Coordinates are given to 3 decimal places
## i.e. rounded to the nearest multiple of 0.001 units (one unit = 924 feet)
## 
## Multitype:
##          frequency proportion intensity
## blackoak       135 0.05997335       135
## hickory        703 0.31230560       703
## maple          514 0.22834300       514
## misc           105 0.04664594       105
## redoak         346 0.15370950       346
## whiteoak       448 0.19902270       448
## 
## Window: rectangle = [0, 1] x [0, 1] units
## Window area = 1 square unit
## Unit of length: 924 feet

8.

There are a total of 2,251 trees in the lansing data.

9.

The most abundant tree is hickory and the least abundant tree is black oak.

10.

  1. For the two most abundant species, hickory and maple, both appear to be aggregated (with maple appearing to be more aggregated).
  2. For the least abundant species, black oak, it appeared to be more dispersed.

11.

  1. For hickory, I obtained a p-value of less than 2.2e-16; this suggests it is very unlikely this pattern is random. For maple and b) black oak, I obtained similar results. This was done using the default 5 by 5 grid of tiles.

12.

When increasing the quadrat size, the chi squared increases and the p-value remains the same; the earlier interpretation appears to be robust to variation in quadrat size.

13.

The two other ways I found to write the command are as follows:

rpoispp(500)|>
  nndist(k=1:500)|>
  apply(2, FUN= mean)|>
  plot()

nn_curve <- apply(nndist(rpoispp(500), k=1:500), 2, FUN = mean)
plot(nn_curve)

14.

The plot suggests that maples are more clumped in the landscape; compared to the random line, the maples have lower average nearest neighbor values than the expected random outcome line.

15.

This plot for cells suggest that they are more dispersed; the cells have higher average nearest neighbor values than the random expected outcome line.

16.

The data for hickory wanders above the confidence band; this graph suggests slight clumping in the hickory data.

17.

The data for black oak goes above the confidence band; this graph suggests clumping in the black oak set.

18.

The data for cells goes below the confidence band; this graph suggests aversion in the cells data.

19.

The data for the longleaf goes above the confidence band; this graph suggests clumping in the longleaf data.