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

Converting "ppp" to multitype

I have been running two unmarked planar point pattern data sets through a series of spatstat functions. Now I would like to use the Kcross.inhom function to describe interaction between the two, but Kcross only works with marked data, so I have…
1
vote
1 answer

Normalizing data in r using population raster

I have two pixel images that I created using spatstat, one is a density image created by a set of points (using function density.ppp), and the other is a pixel image created from a population raster. I am wondering if there is a way to use the…
Michael
  • 11
  • 1
  • 5
1
vote
1 answer

Finding euclidean distance between separate but linked points confined by an irregular polygon window

I followed the post Finding euclidean distance in R{spatstat} between points, confined by an irregular polygon window to the end and made it all work, great. In my case however I want to get the distance points in data A to points in data B but only…
wraymond
  • 295
  • 1
  • 6
  • 17
1
vote
1 answer

Extrapolating spatial point patterns using R

I was wondering if there's a built-in function to extrapolate a point pattern outside the 'parent' window in R. For instance, let's generate a spatial point pattern 'X': require(spatstat) X <- ppp(runif(200), runif(200), c(0,1), c(0,1),…
ToNoY
  • 1,358
  • 2
  • 22
  • 43
1
vote
1 answer

Spatstat: Given a list of 2-d points, how to connect them into a polygon, and further make it the study region?

Please allow me to start the question with a simplest task:If I have four points which are vertices of a rectangle, stored in a 4x2 matrix, how can I turn this into a rectangular window? (Please do not use any special command specific to drawing…
nobody
  • 815
  • 1
  • 9
  • 24
1
vote
1 answer

converting image to data frame with columns for coordinates and pixel value in R

I want to convert a remote sensing image into data.frame with two column for xy coordinates and third column for the pixel value. This is the default data input for ppmlasso. The original image is imported in R as matrix with no prior coordinates.…
Djaner Emin
  • 35
  • 1
  • 6
1
vote
1 answer

Converting matrix into im object from package spatstat - rows are in reverse

first time user here. I am converting matrix into im object from package spatstat. However, top left value from the matrix mat[1,1] is written in the down left corner of the image e.g. the im function reads the rows of the matrix from top to bottom…
Djaner Emin
  • 35
  • 1
  • 6
1
vote
1 answer

R package 'spatstat': installation problems

The installation of the 'spatstat' package works fine. But when I load the package with >library(spatstat) I get the following response: Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : es gibt kein Paket namens…
1
vote
1 answer

R spatstat: Units of distances retrieved by nndist

I’m ashamed bothering you with a stupid (but very necessary to me) question. I’ve a bunch of lat/lon points distributed almost randomly within a rectangle of ca. two x three degrees (latitude x longitude). I need to calculate the maximum distance…
perep1972
  • 147
  • 1
  • 9
1
vote
1 answer

How to count line segment occurrences by pixel in R?

I am trying to convey the concentration of lines in 2D space by showing the number of crossings through each pixel in a grid. I am picturing something similar to a density plot, but with more intuitive units. I was drawn to the spatstat package…
bph
  • 23
  • 8
1
vote
1 answer

R: Get all xy-coordinates at the intersection of lines within one SpatialLines(DataFrame)

I'm looking for a way to get the xy-coordinates of all the intersections within one SpatialLines object or SpatialLinesDataFrame. I have found the function gIntersect of rgeos but that only looks at the intersection between two datasets. Since I am…
1
vote
2 answers

An error on Ripley's K function on spatstat

I would like some help with the Kest function on spatstat. I'm trying to calculate de Ripley's K for my simulate data. When I try to run the function the R show me some error, that says: Error: 7 segments do not lie entirely inside the…
1
vote
2 answers

Table of shared edges for a Voronoi tesslleation

I'm attempting to create a table of polygon neighbors based on a Voronoi tessellation (aka Dirichlet tessellations or Thiessen polygons) generated by the dirichlet() function of the spatstat library. For example, in the figure below, the upper right…
Bryan
  • 1,771
  • 4
  • 17
  • 30
1
vote
1 answer

Unexpected behavior in spatstat hyperframes?

I am trying to make spatstat hyperframes from lists hyperframes containing of owin objects (or any spatstat objects for that matter), but face unexpected behavior when using rbind.hyperframe command in do.call to bind the lists into a larger…
Mikko
  • 7,530
  • 8
  • 55
  • 92
1
vote
1 answer

How to plot multiple 'image' and 'plot.default' graphics in a same device?

I have a function, which uses spatstat's colourmap function to generate a color scale to a plot. The colourmap function uses the image function to plot the color scale. Here is an example: library(spatstat) set.seed(1) dat <- data.frame(x = 1:10, y…
Mikko
  • 7,530
  • 8
  • 55
  • 92