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

How to rotate psp objects by anchoring the middle point in spatstat?

I have a line segment pattern, which is in 90 degrees angle to another line: require(spatstat) range <- c(0,10) owin <- owin(xrange = range, yrange = range) l1 <- psp(x0 = 8, x1 = 8, y0 = 2, y1 = 8, window = owin, marks = "l1") l2 <- psp(x0 =…
Mikko
  • 7,530
  • 8
  • 55
  • 92
1
vote
1 answer

How to assign marks to spatstat objects within loops / apply commands?

Some of spatstat functions, such as crossing.psp do not allow to assign marks within the function. I am making a complicated function with for loops and lapply commands, which calls for marks in ppp and psp objects. I am experiencing problems when…
Mikko
  • 7,530
  • 8
  • 55
  • 92
1
vote
2 answers

How do you control the pixel color in spatspat's plot.tess?

I'm producing a tesselation of random points within a heart shape, I'm having a difficult time figuring out how to control the color of the pixels in the plot. I thought as plot(tess) (in this example) produces a plot of image values, I would be…
Andy W
  • 5,031
  • 3
  • 25
  • 51
0
votes
1 answer

Creating raster with PatchStat values from SDMTools in R

I have a raster file of land cover which I have reduced to contain just tree cover cells. I have used clump in the raster package to clump() together contiguous areas of forest. This gives all cells touching one another the same ID because they are…
Adam
  • 1,147
  • 3
  • 15
  • 23
0
votes
3 answers

Trying to make a spatstat window out of an esri shapefile

I've converted the shapefile to class SpatialPolygons and that to a window with as(x, "owin") but I can't find anything that will work with ppp(x, y, poly= _______ ) What format do I have to get the shapefile in to use it as a window in a PPP…
0
votes
1 answer

What would be the procedure in spatstat for an quantitatively bivariate marked analysis of 1 or more pattern of points?

Given a pattern of points X1 and X2, each with quantitative marks, for example growth as diameter. What would be the strategy for bivariate comparison between the X1 and X2 pattern points, using a mark correlation function (markcorr), for example? I…
Tieygons
  • 43
  • 5
0
votes
2 answers

'invalid permissions' in VS Code running quarto file with R code

I'm running R code in a .qmd file using VS Code and plot results using r.plot.useHttpgd. In various cases I get an *** caught segfault *** error. Reproducible example library(spatstat) plot(amacrine) # This works fine plot(unmark(amacrine)) # It…
samu
  • 45
  • 4
0
votes
1 answer

Calculate area from binary image

Ahead, I'm not able to provide a minimum working example since I don't know how. I have an binary mask in an owin. Basically, my data contains five clumped dots of different size. I try to get their area. As far as I know, the great spatstat package…
Qiyuan
  • 109
  • 10
0
votes
1 answer

Is where a way to find close pairs within a specific box eround each point in spatstat?

I'm working with spatstat package in R. I have marked point patterns with mark variables Name, boxA, boxB. BoxA and boxB are dimensions of a rectangle around each point (bounding boxes). here is an example: >split(u) # splits pattern in two classes…
Sergej S
  • 37
  • 4
0
votes
1 answer

Appropriate covariate for cdf.test.ppp in spatstat

I am trying to assess the spatial homogeneity of cells I have cultured. I have successfully managed to obtain the x,y coordinates of the cells in a square image using Image J (an image of cell nucleuses stained with DAPI). After importing the…
0
votes
0 answers

Question about an inhibition process spatstat

I am working with a data set of a pattern of spatial points that present an inhibition process but caused by angles, that is, they repel each other according to a given angle (azimuth of 0, 45, 90, 135, 180, 225, 270 and 315) and not by distance, my…
0
votes
1 answer

SPATSTAT code for molecular pattern for a image

Can't interpret X as a point pattern, ask for help! library(imager) library(spatstat) Read image img <- load.image("C:/Users/yyan2/Documents/Dec 21/F10F.jpg") img_gray <- grayscale(img) threshold <- 0.5 # adjust this value as needed img_thresh <-…
0
votes
1 answer

Testing inhomogeneous patterns in spatstat

I applied the permutation test on my data to test if they are inhomogeneous, present on page. 689 of the spatstatbook. As an example of the bronze filter data. To do so, I unmarked my points and ran the two tests (I also divided my area into 6…
Tieygons
  • 43
  • 5
0
votes
1 answer

How to add/join several g functions to obtain intra and interspecific spatial patterns in spatstat?

Considering a plant community, whose one of the objectives is to investigate intra and interspecific spatial patterns, I would like to know whether by evaluating the patterns of each pair equal (intra) and different (inter), and then adding them…
Tieygons
  • 43
  • 5
0
votes
1 answer

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 surface with hectare per square km…