Questions tagged [spatstat]

spatstat is an R package for analysing spatial data, mainly Spatial Point Patterns.

spatstat is an R package for analysing spatial data, mainly Spatial Point Patterns. It also supports three-dimensional point patterns, and space-time point patterns in any number of dimensions. The package contains over 1000 functions for plotting spatial data, exploratory data analysis, model-fitting, simulation, spatial sampling, model diagnostics, and formal inference. Data types include point patterns, line segment patterns, spatial windows, pixel images and tessellations.

Resources:

441 questions
3
votes
1 answer

How to get covariate data from a geographic raster for `ppm`?

I want to fit a Poisson point-process model with spatstat::ppm and I'm unsure what is the best way to feed covariate data to the function. I understand that spatstat expects planar coordinates, so I have transformed my point location data to a…
Gregory
  • 4,147
  • 7
  • 33
  • 44
3
votes
1 answer

directional testing of spatial clustering by distance from source

I have a spatial dataset of animal locations, as (x,y) points around a source (circular pattern with 5 km radius). I need to test whether the points are clustered (or repulsed) around the source relative to farther from the source, while accounting…
user2602640
  • 640
  • 6
  • 21
3
votes
0 answers

ppmlasso Predicted intensity maps

I'm currently working on Species Distribution Models and particularly with the framework developed by Ian Renner under the ppmlasso package in R. I have some questions about this framework which have been design in order to be used by practitioner…
Clem H
  • 31
  • 1
3
votes
2 answers

plot residuals in spatstat without overlaying points

This might be very simple but I have spent quite a lot of time trying to figure it out without any luck, maybe anyone can help me. I have point pattern model fitted through the ppm() function in spatstat, (reproducible code below) and when I plot…
3
votes
2 answers

Creating ppp objects with lapply (package spatstat)

My ultimate goal is to calculate Clark-Evans-Index (clarkevans.test) for a list of data frames using package spatstat. So I have a list of my point data: points.li <- list(structure(list(x.n = c(-1.37977544977995, 0.0787053126116266,…
erc
  • 10,113
  • 11
  • 57
  • 88
3
votes
3 answers

Finding the minimum distance between all points and the polygon boundary

I would like to find the minimum distance between points and polygon boundary (all points lie inside the polygon). If that is possible, how can I extract the values?, so I can find a correlation between numbers of individuals and the distance from…
3
votes
1 answer

Clustering function in R constrained to road network

I am analysing STATS19 road accident data, commendably made available to the public by the UK government. I would like to look at how clustered different types of accidents are. The "G function" (described here) can be used to measure the divergence…
RobinLovelace
  • 4,799
  • 6
  • 29
  • 40
3
votes
1 answer

Merge two polygon regions into a single polygon region in R

I'm new to working with spatial data and polygons in R. I have two separate shape files of two polygons that I extract from Google Earth. So basically the first shape file is a location (such as a shopping mall etc.) and the second shape file is a…
Carmen
  • 117
  • 1
  • 7
3
votes
3 answers

How do I ensure that the polygon in spatstat::owin(poly=) does not have "negative area"

I am a new user of the R spatstat package and am having problems creating a polygonal observation window with owin(). Code follows: library("maps") library ("sp")` library("spatstat") mass.map <- map("state", "massachusetts:main", fill=T) # This…
user2793761
  • 183
  • 1
  • 3
  • 6
3
votes
2 answers

How to get a SpatialPolygons (SP-class) from a set of segments (psp in spatstat)?

I have a set of random segments drawing a kind of tessellation (of triangles, rectangles ...) in a window (in spatstat R). I need to convert it into a set of polygons (SpatialPolygons) to calculate some indices (like area, shape indices ...). This…
3
votes
2 answers

Generating a Hexagonal Lattice Using Spatstat

I'm analyzing the growth pattern of certain particles, and want to compare the point pattern with that of a perfectly hexagonal lattice with the same intensity (same number of points per unit of area). I've written a function that does this, but it…
MikeZ
  • 345
  • 1
  • 4
  • 15
3
votes
3 answers

R (spatstat): Built-In Functions Not Evaluating to Desired Limit

So the problem I've run into is pretty basic, but I can't seem to solve it. I've been working with spatstat's F, G, J, K, and L functions, and I want to plot the F function for one point process on the same plot as the F function for a different…
MikeZ
  • 345
  • 1
  • 4
  • 15
2
votes
1 answer

Plotting quadrat counts as an intensity map in R

I have a point data set of crimes for a city. Using quadratcount() through the spatstat package, I plotted the quadrat counts of this data set. Figure 1 shows an image of the counts of data points per quadrat and was created through this…
Fritz
  • 21
  • 2
2
votes
1 answer

how check overfitting on point pattern on a linear network using spatstat

I have been using lppm (point pattern on a linear network) on spatstat with bunch of covariates and fitting a log-linear model but I couldn't see how to check over-fitting. Is there a quick way to do it?
iHermes
  • 314
  • 3
  • 12
2
votes
1 answer

Does {spatstat}'s `nearestsegment()` produce imprecise results?

Although, the figure is rather small, one can see that several points/events (lightred) do not lie on colored line segments and vice a versa. Where does this deviation come from? Is there a way to improve my procedure? Why I am doing this? Overall…
Pax
  • 664
  • 4
  • 23
1
2
3
29 30