spatstat

1-dimensional Point-Process in R (spatstat)

拈花ヽ惹草 提交于 2021-02-18 19:33:32
问题 I have asked another question, which was closed as Too Broad. Now, I will try to specify. Again, I would like to simulate a 1-dimensional point process in R. So far, I've only been working on 2-dimensional simulations and would need a bit of help. My goal is a simulation like in the picture But, I only need the real line with the random points on it. I use spatstat and have already found out that I can generate random points on a 1-dim Line with: rpoisppOnLines(lambda, L, lmax = NULL, ...,

Crating Kernel density estimate for polygon in R

不想你离开。 提交于 2021-02-11 12:29:30
问题 I Have a shapefile of polygons and another one of points that are distributed over the polygons. I would like to create a kernel density estimate for each polygon based on the points it contains. unfortunately I was only able to create squared KDEs with the kde2d function from the MASS package. I would like the KDEs to be shaped as the polygons. Any suggestions? kde1 <- kde2d(poly$X, poly$Y, n=100,) enter image description here 回答1: You can use the spatstat package for this. Here is an

Quadrats in Spatstat

与世无争的帅哥 提交于 2021-01-07 01:28:26
问题 I am now doing exploratory analysis and the objective is to plot a quadrat map, determine if there exists complete spatial randomness (visually and using chi-square test), etc. However, I am having trouble plotting a quadrat map. I previously asked this question that led me to reproject my data. Here is my code: library(rgdal) #Brings Spatial Data in R library(spatstat) # Spatial Statistics library(maptools) library(raster) # Load nyc zip code boundary polygon shapefile s <- readOGR("/Users

data frame object to use as as.linnet object

人走茶凉 提交于 2020-06-17 07:28:29
问题 I have a data.frame object which I can easily convert to a spatialpointdataframe then convert that to a spatiallinesdataframe but then when I tried to cover to a as.linnet it does not read marks X Y roadID 1 177321.3 3378163 1 2 177321.4 3378168 1 3 177321.4 3378168 1 4 177321.5 3378177 1 5 177321.5 3378186 1 6 177321.5 3378195 1 then I make this data.frame to a SpatialPointsDataFrame coordinates(roaDF1) <- c("X","Y") proj4string(roaDF1)=proj4string(trtrtt) class : SpatialPointsDataFrame

data frame object to use as as.linnet object

不想你离开。 提交于 2020-06-17 07:28:10
问题 I have a data.frame object which I can easily convert to a spatialpointdataframe then convert that to a spatiallinesdataframe but then when I tried to cover to a as.linnet it does not read marks X Y roadID 1 177321.3 3378163 1 2 177321.4 3378168 1 3 177321.4 3378168 1 4 177321.5 3378177 1 5 177321.5 3378186 1 6 177321.5 3378195 1 then I make this data.frame to a SpatialPointsDataFrame coordinates(roaDF1) <- c("X","Y") proj4string(roaDF1)=proj4string(trtrtt) class : SpatialPointsDataFrame

Use sf polygon object as window in spatstat

六眼飞鱼酱① 提交于 2020-02-25 13:16:39
问题 Hello all potential helpers, I have a SpatialPolygonDataFrame object obtained from the tigris package and I would like to use it as a polygonal window in the creation of a ppp object. Here is what I tried: # Needed packages library(spatstat) library(sf) # Download geospatial data for Lee county in Alabama (home of the great Auburn University by the way!) county <- tigris::county_subdivisions(state = "Alabama", county = "Lee") # The polygon of Lee county is subdivided, so I convert it to a

what is the Beta valuel when simulate a hybrid Geyer model using spatstat, R package

烂漫一生 提交于 2020-02-06 12:52:31
问题 I fit a hybrid geyer model including a hardcore and a geyer saturation components, now I want to simulate the fitted model by rmh() in spatstat, the code is following: mo.X<-rmhmodel(cif=c("hardcore","geyer"), par=list(list(beta=0.0001746418,hc=30.31542), list(beta=1, gamma=0.4195612,r=122,sat=2)), w=Window(A1a2.unmark)) there are two beta in simulating the hybrid model: beta for hardcore(), and beta for geyer (), however, when fitting real data to get a hybrid model, only one beta value

what is the Beta valuel when simulate a hybrid Geyer model using spatstat, R package

﹥>﹥吖頭↗ 提交于 2020-02-06 12:51:27
问题 I fit a hybrid geyer model including a hardcore and a geyer saturation components, now I want to simulate the fitted model by rmh() in spatstat, the code is following: mo.X<-rmhmodel(cif=c("hardcore","geyer"), par=list(list(beta=0.0001746418,hc=30.31542), list(beta=1, gamma=0.4195612,r=122,sat=2)), w=Window(A1a2.unmark)) there are two beta in simulating the hybrid model: beta for hardcore(), and beta for geyer (), however, when fitting real data to get a hybrid model, only one beta value

Converting point process model intensity predictions to probabilities at specific points spatstat

∥☆過路亽.° 提交于 2020-01-25 10:12:25
问题 I am working on a similar dataset as the chorley dataset in the spatstat package and am following a similar analysis as presented in the sample book chapter, Spatial Point Patterns: Methodology and Applications with R. https://book.spatstat.org/sample-chapters/chapter09.pdf library(spatstat) data("chorley") X <- split(chorley)$larynx D <- split(chorley)$lung Q <- quadscheme.logi(X,D) fit <- ppm(Q ~ x + y) locations = data.frame(x=chorley$x, y=chorley$y) pred <- predict(fit, locations =

Converting point process model intensity predictions to probabilities at specific points spatstat

旧街凉风 提交于 2020-01-25 10:12:07
问题 I am working on a similar dataset as the chorley dataset in the spatstat package and am following a similar analysis as presented in the sample book chapter, Spatial Point Patterns: Methodology and Applications with R. https://book.spatstat.org/sample-chapters/chapter09.pdf library(spatstat) data("chorley") X <- split(chorley)$larynx D <- split(chorley)$lung Q <- quadscheme.logi(X,D) fit <- ppm(Q ~ x + y) locations = data.frame(x=chorley$x, y=chorley$y) pred <- predict(fit, locations =