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

Is there a way to convert the plot derived from Spatstat's K function into a ggplot or grob?

I am trying to use ggarrange from ggpubr to create a multiple plot of Ripley's K function from spatstat, i.e. I calculate Ripley's K using Kest() for 5 landscapes and then plot them all together. Such as: kk1plot<-plot(Kest(landscape)) However I am…
OpenSauce
  • 354
  • 2
  • 14
1
vote
2 answers

how to create a 3 dimensional circle window in spat stat?

I am struggling to create a 3d disc window for the pp3 in spatatat. the shape of the window is similar to a petri dish: a radius of 5cm and the wall is 3 cm high. i managed to create a 3d box, but i cant figure how to do it for a circle. is it…
dor sh
  • 11
  • 2
1
vote
1 answer

linfun function problem (unused arguments)

I'm trying to run this code, but I'm having some problem with the linfun function, and I don't know how to fix it. The error is: "Error in linfun(a = x.T, d = -sum(x.T * w)) : unused arguments (a = x.T, d = -sum(x.T * w))" Does someone know how to…
1
vote
2 answers

How to convert "im" pixel image to raster?

I am trying to convert an "im" pixel image I've produced into a raster image. The "im" was created with the following code: library(sf) library(spatstat) library(rgeos) library(raster) # read ebird data ebd_species <- ("ebd_hooded.txt") %>% …
simka999
  • 13
  • 4
1
vote
1 answer

How to figure out the parameters from mppm in R

I am working using the spatstat library in R. I have several point pattern objects built from my own dataset. The point patterns contain only the x and y coordinates of the points in them. I wanted to fit the point patterns to a Gibbs process with…
sanjana
  • 15
  • 5
1
vote
1 answer

Artifact correction in spatstat for biological cells point patterns

I am using spatstat to analyze biological cells (dependencies, interactions, etc.) with their centers to generate point patterns. However, I realize the artifact caused due to their sizes in 2D. What are the best ways to correct such artifacts when…
user2167741
  • 277
  • 1
  • 10
1
vote
1 answer

grade separation and shortest path on networks in spatstat

I have a question not on spatstat but on use and limitation of spatsat. During the calculation of metrics like pcf and k function equivalents on linear networks, a shortest path distance is used instead of euclidean distance. I have the spatsat book…
BKS
  • 141
  • 1
  • 10
1
vote
1 answer

Relative risk estimation in spatstat

I am running into problems when computing the relative risk estimation (relrisk.ppp) of two point patterns: One with four marks in a rectangular region and the other with two marks in a circular region. For the first pattern with four marks, I am…
user2167741
  • 277
  • 1
  • 10
1
vote
1 answer

Importing one dimensional dataset for Complete Spatial Randomness win spatstat

I have a set of one-dimensional data points (locations on a segment), and I would like to test for Complete Spatial randomness. I was planning to run Gest (nearest neighbor), Fest (empty space) and Kest (pairwise distances) functions on it. I am…
Max_IT
  • 602
  • 5
  • 15
1
vote
1 answer

Project longitude and latitude to planar coordinates system

Disclaimer: I am currently using the ppp branch version of the {sf} package, because new features for converting objects between {sf} and {spatstat} are available in it (see https://github.com/r-spatial/sf/issues/1233). For it to work properly, I…
SavedByJESUS
  • 3,262
  • 4
  • 32
  • 47
1
vote
1 answer

Number of dummy points in spatstat

I'm fitting a inhomogeneous Poisson model to a spatial point pattern dataset with function ppm (spatstat package) that uses Berman-Turner quadrature approximation for estimating the parameters by MLE. By default, for computational reasons, the…
G. Bunino
  • 13
  • 4
1
vote
1 answer

the meaning of cluster size in Cox process models in spatstat

for some tree wood, the conduits in cross sections clearly aggregate as clusters. it looks natural that the Cox process modeling in spatstat (r) could be fitted for the conduits point data, and the results include a estimated "Mean cluster size". I…
Jingming
  • 11
  • 4
1
vote
2 answers

Is it possible to analyse a spatial point pattern given another, underlying, spatial point pattern in R

I want to analyse the type of spatial pattern shown by an animal (i.e. random, clustered, uniform) taking into consideration the underlying spatial pattern of it's available habitat. The animals in question roost in trees, so a standard analysis of…
Tam42
  • 21
  • 1
1
vote
1 answer

how to convert a list of nx3 matrices into a list of spatial patterns

I have a list containing n x 3 matrices. WHere the first column are the X-Coords, the second column is the Y- Coords and the third column is a value ( 1's and 0's). how do iterate through this list to output a list of spatial patterns. I have tried…
1
vote
2 answers

Set weights for ewcdf {spatstat} [R]

I want to compare a reference distribution d_1 with a sample d_2 drawn proportionally to size w_1 using the Kolmogorov–Smirnov distance. Given that d_2 is weighted, I was considering accounting for this using the Weighted Empirical Cumulative…
Gion Mors
  • 313
  • 1
  • 3
  • 20