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
2
votes
2 answers

error in leverage function: number of items to replace is not a multiple of replacement length

I am having some troubles trying to produce a leverage plot for a point pattern model in spatstat. This is weird though, because yesterday it worked perfectly fine with the exact same model, and now it just doesn't. I have a model with 3 covariates…
2
votes
0 answers

Spatstat not available for R 3.2.3

I am trying to install the package Spatstat from a CRAN mirror in Germany (Münster) in R version 3.2.3, and it hasn't been possible because the package is not included into the packages list available to be installed. There is a similar question…
Ana Prieto
  • 23
  • 4
2
votes
3 answers

measuring distance between points by ID in spatstat

I'm trying to measure the distance that nestlings moved from their original nest sites to territories they established the next year. I'd like to do this using the spatstat package, but I'm having trouble with the output with some of its functions…
Jason
  • 892
  • 1
  • 8
  • 19
2
votes
2 answers

How to get the color coded plotted areas in images using R?

Hi R expert of the world, Assume I have a point pattern that generate an intensity map and that this map is color coded in 3 region in an pixeled image.... how could I get the color-coded area? here it is an example using…
saccente
  • 21
  • 1
2
votes
1 answer

How is eps used in density.ppp()?

I'm using density.ppp() to get an intensity function for a series of coordinates. The data is projected and is in units of meters. I'm trying to estimate number of points/km, so after looking at the documentation I used eps = 1000 to set the…
Emma
  • 23
  • 2
2
votes
1 answer

An irregular polygon area as plot on spatstat

it's my first time using the spatstat package, so I would like some advice. I am attempting to plot coordinate data into a irregular polygon area (format .shp), to calculate spatial analysis like Ripley's K. How can I add an irregular polygon area…
2
votes
1 answer

space-time clustering :: point patterns in different spaces

By following these instructions from Thomas I have created a ppp object using the spatstat package in R. Because my data set includes a time dimension, I want to expand this analysis to consider the 3D space-time for clustering analysis. The…
2
votes
2 answers

Convert Spatial Polygons Data Frame to OWIN

I am new to R and a new to programming. I have a shapefile which I have imported into R and found that it is a Spatial Polygons Data Frame. I want to use the crossdist function in spatstat but before that I am attempting to convert this into owin…
user3211273
  • 31
  • 1
  • 3
2
votes
1 answer

Shapefile, feature class or network dataset into R

I am working in the spatstat package in R and I would like to create an object of "linnet" (network) class from a shapefile. Unfortunately, while I am able to obtain the locations of all nodes in the network from the ArcGIS, I cannot figure out the…
mihoo
  • 157
  • 3
  • 12
1
vote
0 answers

R maptools or rgdal package--how to fill the outside of a polygon?

I am trying to plot a shapefile of polygons on top of another shapefile that already has colored polygons using R, and I am working with maptools and rgdal. I want to clip the bottom shapefile (which has multiple polygons) to the area delimited by…
user1260251
  • 83
  • 1
  • 1
  • 8
1
vote
1 answer

How to use inhomogeneous models fitted in the calculation of envelopes in spatstat?

This question involves conceptual issues, however, it also involves code. Given a heterogeneous pattern of points, dependent on terrain slope and elevation, for example, obtained from a fit of a poisson model where lambda is equal to a loglinear…
Tieygons
  • 43
  • 5
1
vote
2 answers

How to convert a Mean Cluster size result that is in [pixel image] to the number of mean points per cluster in spatstat?

Given a inhomogeneous cluster model, associated with a variable Z as an object of class 'im', how to convert the result of the number of mean points per cluster (Mean cluster size) in pixel image to the average number of individuals per cluster? For…
Tieygons
  • 43
  • 5
1
vote
3 answers

R Spatstat: Identify nearest neighbours for further use

I have a dataframe with 488 GPS points (long and lat). For each 488 points I would like to find their 2 closest neighbours. So far I have created a point pattern object and computed the distance from the nearest two points (below). However, I would…
bellbyrne
  • 67
  • 7
1
vote
1 answer

variability in spatstat envelope() results

I am using envelope() to create simultaneous critical envelopes. I noticed that when I ran 39 simulations that the envelope I created changed the interpretation for CSR when I repeated the simulation several times. I would expect some variability…
JRS04473
  • 13
  • 2
1
vote
2 answers

How can I convert a 'pp3' dot pattern into an 'im' object in spatstat?

My goal is to create an im object from terrain elevation data (pp3's z-axis), similar to bei.extra ($elev and $grad). I started by creating a pp3 object from my data set: x <- elev_test$x y <- elev_test$y z <- elev_test$z X <- pp3(x, y, z, c(0,…
Tieygons
  • 43
  • 5