Questions tagged [spatstat]

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

spatstat
Filter by
Sorted by
Tagged with
1 vote
2 answers
71 views

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 <- ...
0 votes
1 answer
79 views

How can I get multiple outputs from single operation?

These are the codes that have been written to analyze within and between interactions of different species. in this code, I tried to get separate outputs from each analyzes unsuccessfully. ...
0 votes
1 answer
44 views

spatstat or R alternative to ESRI Point Density Tool?

I am trying to figure if it is best possible way to replicate ESRI point density tool in spatstat R package. I got bunch of archaeological sites location with associated size and would like to compute ...
0 votes
1 answer
60 views

It's possible to create envelopes for combinations of mark correlations with spatstat , generated from markcrosscorr?

I would like to know if it is possible to create envelopes for combinations of mark correlations with spatstat , generated from markcrosscorr. In the example on page 645 of the book (2015), I saw that ...
1 vote
2 answers
59 views

Is it reasonable to use AIC to rank point process models that are based on different likelihood functions (Poisson and Gibbs in this case)?

I am using spatstat version 3.0.2 to explore settlement patterns in archaeological data in five different periods throughout prehistory. I have formulated several point process models with different ...
2 votes
1 answer
641 views

Interpreting spatial relationships between points with different marks (multitype point pattern) - using spatstat - and better visualize the results

Let me start off by mentioning that I have no training in statistics and I am new in this field for both spatial statistics and coding in R. However, I am trying to learn how to identify and ...
0 votes
1 answer
42 views

How can I improve the estimation for clustering models using kppm function in spatstat

I have simulated some point pattern from Thomas and MatClust models and, I was trying to fit the parameters of the model using kppm() function from spatstat. Nevertheless, I obtained a no good ...
0 votes
1 answer
113 views

Is there a way to compute the standard error for GAM models using effectfun() within spatstat?

I am using spatstat version 3.0.2 to explore settlement patterns in archaeological data in five different periods throughout prehistory. I have formulated several point process models with different ...
0 votes
1 answer
31 views

Building kppm model from clusterfit parameters

Following the steps in the answer given here, I've fit Thomas cluster model parameters kappa and sigma to the pooled Kinhom functions of a set mppm intensity predictions. By "transferring" ...
0 votes
1 answer
160 views

How to interpret the different results of pcfcross, markconnection and markcorrelation function?

I want analyze the spatial correlation between different life history stages of different tree species. I used three different summary statistics, namely, pcfcross, markconnect and markcorr functions. ...
0 votes
1 answer
73 views

'spatstat' package: Fitting cluster process models

I have several questions regarding fitting cluster process models using the spatstat package, to solve a problem I am working on. Is there a recommended minimum sample size consideration when fitting ...
0 votes
1 answer
53 views

How to make the covariate in rhohat() a factor?

I'm trying to use the rhohat() function to estimate changes and I have my ppp file and image file. When I run the fuction I get this error Error in spatialCovariateEvidence.exactppm(model = list(X = ...
1 vote
1 answer
56 views

Show all symbols in legend in spatstat

I'm plotting a forest with trees as in the sample data lansing in spatstat. My code is as in this example: plot(lansing, cols=rainbow(length(unique(lansing$marks))), leg.args=list(y.intersp = ...
0 votes
2 answers
86 views

spatstat integer overflow error in Kcross and crosspairs

I'm working with spatstat 2.3-4 in R 4.1.0 on a 64bit windows 10 pro machine. Recently I ran into the integer-overflow error while using Kcross with a large number of points (i.e. the number of ...
1 vote
1 answer
48 views

Using nndist.ppx to obtain near neighbor distances in multidimensional point pattern

I am fairly new to R and programming in general, so I appreciate your input. I'm trying to obtain the nearest neighbor distances for a set of points. My data consists of the scores on the first 4 ...
0 votes
1 answer
135 views

Is there a way to perform quadratcount() in spatstat without ignoring the marks?

Imagine I have a point pattern distribution in a square and all points have marks (i.e. plant trait data). I want to divide this square in f.e. 4 quadrats. Now I am interested in the spatial ...
1 vote
1 answer
87 views

Model a 3D Point Pattern using spatstat

Is there any way to fit a spatial statistical model to 3d data in spatstat? I have tried using the functions such as ppm and kppm but they are not working for pp3
0 votes
1 answer
154 views

Error: x,y coords given but no window specified (spatstat)

I am generating a landscape pattern that evolves over time. The problem with the code is that I have clearly defined a window for the object bringing up the error but the window is not being ...
0 votes
1 answer
122 views

where do I find the definition of class objects in spatstat

I would like to know what kind of information an object of class Spatialpolygons has versus an object of class Polygons.
0 votes
1 answer
34 views

Gibbs models for numerically marked data?

I am analyzing data similar to the "anemones" data in spatstat, where my data also consists of disks of varying diameters. My goal is to test for significant regularity, or inhibition ...
0 votes
1 answer
80 views

Simulate a list of kppm objects in R spatstat

I would like to use envelope simulation on a list of kppm objects. I have a point dataset that is in a grid pattern. I would like to shift each point such that its position in the cell is random, then ...
0 votes
1 answer
64 views

Area under the curve for Kcross: Multitype K Function

I am using spatstat to run Kcross: Multitype K Function (Cross-type). Here is my data set and here is the script plotting K Cross df <- read.csv(file = "trees_rocks.csv") df.test <- ...
0 votes
0 answers
71 views

draw figures on a map with `sf`

I am struggling to find a systematic way to convert coordinates and geometries to km. Let's say I have a .shp file, which I read with st_read. I want to draw a circle of radius 10 kms around a city. I ...
0 votes
1 answer
69 views

Receiving different measured values from crossK and lohboot

I have a marked ppp dataset looking at crimes and their relation to locations. I am performing an inhomogeneous cross-K using the Kcross.inhom, and am using lohboot to bootstrap confidence intervals ...
0 votes
1 answer
85 views

Analysing polygon marked point patterns using spatstat in R

I have a dataset (data) I want to analyse using spatstat in R. The observed area is a polygon. The marks for my data are numeric values, 1 and 0. If the spot (circle) has a mark of 0, it will be white,...
0 votes
2 answers
96 views

Error: objects 'ripras', 'as.ppp', 'delaunay' are not exported by 'namespace:spatstat'

I got following error whie executing the code. Code:install.packages("ithir", repos="http://R-Forge.R-project.org") Error: WARNING: Rtools is required to build R packages but is ...
0 votes
1 answer
112 views

How to make a better plot with label for marked point patterns using spatstat in R

I have marked point pattern data data. I want to plot the marked point pattern where the marks are only valued at 1 and 0 hence there are two colours only. This is what I have done so far x = c(3,0.5,...
1 vote
2 answers
183 views

How to get the best polygon point pattern data in spatstat analysis in R

I have a dataset of spatial locations data. I want to do a point pattern analysis using the spatstat package in R using this data. I want the best polygon area for the analysis instead of the ...
0 votes
1 answer
77 views

Spatstat: Cluster processes for interactions in marked point patterns?

I am trying to identify clustering patterns between different marks using point process models. Multitype Strauss is the only model I have found thus far which can compare interactions between ...
1 vote
1 answer
93 views

spatstat: Multidimensional Space-Time Point Pattern

I'm trying to model a Multidimensional Space-Time Point Pattern (ppx object from spatstat package). But I didn't find any way at package documentation. I tried this: library(spatstat) set.seed(2022) ...
1 vote
1 answer
806 views

R package 'spatstat' not loading

I have downloaded and installed the 'spatstat' package multiple times, including by downloading the files. But every time I try to run it i get this error Failed with error: ‘package ‘spatstat.data’ ...
0 votes
3 answers
255 views

R spatstat, plot function

In this figure, the axes are not displayed on the plot. How to fix it? Can anybody help me, thank you! plot(swedishpines, axes=TRUE) > dput(swedishpines) structure(list(window = structure(list(...
0 votes
1 answer
42 views

Append spatstat intensity outputs across tesselated surface (derived from shapefile) back to SpatialPolygonsDataFrame for plotting in R

Anyone have advice for retaining (or appending) attributes from a Spatial Polygons Data Frame after conversion to an owin object for pattern analysis in Spatstat? Using spatstat to calculate point ...
-1 votes
2 answers
199 views

Unit of a gaussian smoothing of an image

I had a raster with values from 0 to 0,3 which I transformed into an image. Then i gave all values <=0.3 the value 1. I thought it makes it easier if i calculate this for a single value. I applied ...
1 vote
1 answer
129 views

Creation of correlated marks. E.g. point sizes varying with inter-point distances

I recently dabbled a bit into point pattern analysis and wonder if there is any standard practice to create mark correlation structures varying with the inter-point distance of point locations. ...
0 votes
1 answer
61 views

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 ...
0 votes
1 answer
213 views

Homogenizing scale for density plot

I am making a series of plots from a point pattern (PPP) with the density (kernel) function. I would like that the maximum plotted number is 200 in all cases and just the heatmap accordingly (two of ...
0 votes
1 answer
100 views

Simulation of Poisson cluster process on linear network

On pp. 73-74 in "“Stationary” point processes are uncommon on linear networks"* by Adrian Baddeley, Gopolan Nair, Suman Rakshit, and Greg McSwiggan, the authors introduce a Poisson cluster ...
0 votes
1 answer
129 views

Can't plot image which is converted from a raster

I converted a raster to an image and wanted to plot it. However, I then get the following error: library(raster) r #class : RasterLayer #dimensions : 23320, 37199, 867480680 (nrow, ncol, ncell) ...
0 votes
2 answers
174 views

missing functions in spatstat library (such as Kest, and rpoint)

i'm trying to use the Kest function (and many other in the spatstat package). i have made a ppp point pattern data set (ppp.1) summary (ppp.1) Planar point pattern: 189 points Average intensity ...
0 votes
0 answers
71 views

Spatial randomnes of observations (point pattern)

I want to assess if the observations in my data are spatially randomly distributed over the sampling area (Sweden). I wanted to reproduce the example given in this answer: Spatial Autocorrelation ...
0 votes
1 answer
120 views

R package:s spatstat.explore and spatstat.model need spatstat.random 2.2.0.7 but not available?

I try to install from github spatstat.explore and spatstat.model but this does not work because spatstat.random 2.2.0.7 is needed. I cannot find the latter. Is the development not yet finalised?
2 votes
1 answer
73 views

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 ...
0 votes
1 answer
97 views

Reference bandwidth smoothing in spatstat

Is there any way to use reference bandwidth selection for kernel smoothing in spatstat package?
0 votes
0 answers
53 views

Internal error: X pixel values were NA, even after projection

I am using a library (sparr), which relies on spatstat. After executing a function from sparr, namely LSCV.risk() I am getting the following error: Internal error: 1498 pixel values were NA, even ...
0 votes
1 answer
55 views

Smoothed partial residuals of a covariate in a point process model in spatstat

I am using spatstat to build point process models using the ppm function but I have problems in validation, when I use the residual plot parres to understand the effect of a covariate. The model is ...
0 votes
1 answer
67 views

How do you format a hyperframe in spatstat to be able to run the "mppm" function for point process models?

Below is a list of 3 point patterns with measured tree data. ppp_list [[1]] Marked planar point pattern: 3 points Mark variables: SPCD, DIA, HT window: polygonal boundary enclosing rectangle: [-...
0 votes
0 answers
125 views

Tessellation error in spatstat - Error in as.im.default(image) : Can't convert X to a pixel image

I have been dealing with this for several days and can't find a way out. I'm using spatstat in R for spatial analysis of my cells. I have follow some tutorials, but as always happens, things don't ...
0 votes
1 answer
101 views

Converting intensities to probabilities in ppp

Apologies for the overlap with existing questions; mine is at a more basic skill level. I am working with very sparse occurrences spanning very large areas, so I would like to calculate probability at ...
0 votes
1 answer
152 views

Custom smoothing kernel

I would like to use Smooth.ppp in spatstat to calculate a sort of "moving average" according to a specific function. The specific distance-dependent weights I would like to use are given by ...

1
2
3 4 5
10