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
1
vote
2 answers

Can't use mppm on multitype point patterns

I'm trying to fit a MultiStraussHardcore interaction to one of the sample datatsets in spatstat (flu). I'm maintaining the same interaction and hardcore radius for all types and point patterns. I'm running the following…
jbeds
  • 17
  • 3
1
vote
1 answer

Specification of distances for calculation of marked variogram

In the spatstat package, why doesn't the markvario function allow distances greater than 1/4 of the window length for variogram calculation? markvario(X, correction = c("isotropic", "Ripley", "translate"), r = NULL, method = "density", ...,…
1
vote
1 answer

Error in effectfun and parres for Gibbs Area Interaction model

I am using spatstat v.1.59-0 to build some point process models, but I am having problems with some of the validation tools, specifically effectfun and and the residual plot parres The components of the model are rings_pp which consists of point…
dinapoli
  • 11
  • 1
1
vote
1 answer

How to get the area for a bounding box for each point in a plannar point pattern (ppp) data using Spatstat in R?

I have a point pattern object (ppp) i.e. dataset comprising the geographic coordinates of certain positions. For example: > data(bei) > df1<-as.data.frame(bei) > View(df1) > head(df1) x y 1 11.7 151.1 2 998.9 430.5 3 980.1 433.5 4 986.5…
Lesnar
  • 501
  • 3
  • 16
1
vote
2 answers

How to convert intensities to Probabilities in a point pattern using Spatstat in R?

I have two points pattern (ppp) objects p1 and p2. There are X and Y points in p1 and p2 respectively. I have fitted a ppm model (with location coordinates as independent variables) in p1 and then used it to predict "intensity" for each of the Y…
Lesnar
  • 501
  • 3
  • 16
1
vote
2 answers

Kres function not executing properly due to error in Kwtsum, "Weights in K-function are infinite or NA"

I understand the problem is that the function is trying to sum non-finite values and I think I can fix the issue by removing those values from the ppm object, however I'm having a hard time locating all the specific components the function is trying…
1
vote
2 answers

How to create a hyperframe containing groups of points with marks each associated with a unique window in R

I'm having difficulty converting point patterns to a hyperframes despite on-line searches and consulting Baddeley and Rubak's Spatial Point Patterns: Methodology and Applications with R. I'm new to R and spatial stats. Any help would be much…
Pepe
  • 15
  • 4
1
vote
1 answer

Spatstat What is the scale used on the colour bar when plotting a point pattern?

I am plotting a spatial point pattern of about 11000 points, in a rectangular area with limits c(0,100), c(0,70). I wanted to check the interpretation of the scale on the color bar. The color bar scale runs from 0 to about four. Do these numbers…
Garry
  • 179
  • 13
1
vote
1 answer

Spatial analysis with R package spatstat, sidebar does not show correct values

I'm trying to create a map with the spatstat package of R so that the sidebar shows the values of the third (preferably) or fourth column of my data frame and that the colors are also reflective of that third (or fourth column) chosen. My…
david
  • 11
  • 1
  • 5
1
vote
1 answer

Point patterns analysis : clarkevans.test and edge correction

First I'm really sorry because I'm newR, so I apologise if I missed a previous respond to this question, and I also apologise because I can not join pictures to my text (and I apologise for english fault because I'm not bilingual). I'm working with…
Ellimac
  • 11
  • 1
1
vote
2 answers

Customize breaks on a color gradient legend using base R

Here is a sample script using random numbers instead of real elevation data. library(gridExtra) library(spatstat) #im function elevation <- runif(500, 0, 10) B <- matrix(elevation, nrow = 20, ncol = 25) Elevation_Map <- im(B) custom <-…
Jay
  • 157
  • 1
  • 2
  • 9
1
vote
0 answers

"Error: $ operator is invalid for atomic vectors" when running density.lpp function of the spatstat package in R

I'm analyzing traffic accidents with injuries and deaths of the Bogota city. The data contains the location of 9108 accidents of the year 2015 on a road network of 8218901 meters in length, they were divided by months and each month contain on…
Ines
  • 11
  • 2
1
vote
1 answer

Error in generating a poisson point pattern with calculated lambda

I have a two-dimensional point pattern (no marks) and I am trying to test for clustering in the presence of spatial inhomogeneity using envelopes and the inhomogenous pair correlation function. I am estimating an inhomogenous intensity function for…
1
vote
1 answer

Error in spatstat with R: points were rejected as lying outside

I tried to get the map of Wisconsin and try to do Clark-Evans test on spatial data points. However, when I import the map of wisconsin and try to convert it into a window, I met the error: Warning message: 244 points were rejected as lying outside…
Leonard
  • 139
  • 1
  • 11
1
vote
3 answers

How do I plot species as different colours in a point pattern (ppp) using spatstat in R?

The set up is this: There are 10 trees within a 20 by 20 m quadrat in a forest. For each tree we know the species, the diameter (in cm), and the location within the quadrat using x,y coordinates. I would like to plot the trees within the quadrat,…
Jay
  • 157
  • 1
  • 2
  • 9