0
votes

I have data that contains information about sub-plots with different numbers and their corresponding species types (more than 3 species within each subplot). Every species have X & Y coordinates.

> df
  subplot      species      X       Y
1       1     Apiaceae 268675 4487472
2       1  Ceyperaceae 268672 4487470
3       1     Vitaceae 268669 4487469
4       2  Ceyperaceae 268665 4487466
5       2     Apiaceae 268662 4487453
6       2 Magnoliaceae 268664 4487453
7       3 Magnoliaceae 268664 4487453
8       3     Apiaceae 268664 4487456
9       3     Vitaceae 268664 4487458

with these data, I have created ppp for the points of each subplot within a window of general plot (big).

 grp <- factor(data$subplot)
 win <- ripras(data$X, data$Y)
 p.p <- ppp(data$X, data$Y, window = window, marks = grp)

Now I want to divide a plot into equal 3 x 3 sub-plots because there are 9 subplots. The genetal plot is not rectangular looks similar to rombo shape when I plot.

I could use quadrats() funcion as below but it has divided my plot into unequal subplots. Some are quadrat, others are traingle etc which I don't want. I want all the subplots to be equal sized quadrats (divide it by lines that paralel to each sides). Can you anyone guide me for this?

 divide <-quadrats(p.patt,3,3)
 plot(divide)

Thank you!

2
Please provide some data and example code so we can help you. If you cannot share you actual data then use simulated or built-in dataset to illustrate your problem and what you have tried so far. - Ege Rubak
i have edited an example data frame above. Thank you! - R starter
I'm sorry, but I still think you have to ask a better question. You just provide 9 points in a format that I cannot easily read into R. Maybe give it a try using dput for you data or even better (much better) make a fully reproducible example with figures and explain in detail. I highly recommend the reprex package <reprex.tidyverse.org> where you can add the argument venue = "so": Simply copy the entire script into the clipboard and run reprex(venue="so"). Afterwards paste the result into your question here. Also a hint could be to align the data with the axes using rotate. - Ege Rubak
ok, I will try it. thank you! - R starter

2 Answers

0
votes

Could you break up the plot canvas into 3x3, then run each plot?

> par(mfrow=c(3,3))
> # run code for plot 1
> # run code for plot 2
  ...
> # run code for plot 9

To return back to one plot on the canvas type

> par(mfrow=c(1,1))
0
votes

This is a question about the spatstat package.

You can use the function quantess to divide the window into tiles of equal area. If you want the tile boundaries to be vertical lines, and you want 7 tiles, use

B <- quantess(Window(p.patt), "x", 7)

where p.patt is your point pattern.