I have a data frame
df <- data.frame(x = rep(seq(1:10), 10), y = rep(seq(1:10), each = 10), diameter = rnorm(100, 0.3, 0.03), height = rnorm(100, 0.2, 001))
that I want to convert to the ppp
file by means of the ppp
of spatstat
package. I want that the diameter
and height
variables are marks
and I can not do this. I tried f.ex this
pp1<-ppp(df$x, df$y, marks = data.frame(df %>% select(diameter, height)))
but does not work.
The output I want to have is similar to the data file finepines
that is attached to the spatstat
package
> finpines
Marked planar point pattern: 126 points
Mark variables: diameter, height
window: rectangle = [-5, 5] x [-8, 2] metres