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
1 answer

Identify the largest point within the radius of another point?

Use this example data to see what I mean tag <- as.character(c(1,2,3,4,5,6,7,8,9,10)) species <- c("A","A","A","A","B","B","B","C","C","D") size <- c(0.10,0.20,0.25,0.30,0.30,0.15,0.15,0.20,0.15,0.15) radius <- (size*40) x <-…
Jay
  • 157
  • 1
  • 2
  • 9
1
vote
2 answers

Converting ImageJ ROI to R spatstat data doesn't work

I tried to use the RImageJROI package from David C Sterratt to transfer multiple ROIs into R and convert them to Spatstat. This is a minimal example of my R-code library(RImageJROI) ROI = read.ijzip("path/ROI.zip") spat.ROI =…
Maxi Kießler
  • 23
  • 1
  • 5
1
vote
1 answer

how to find and remove illegal point in spatstat

I am trying to plot a ppp object and i get the following error: In plot.ppp(x = list(window = list(type = "polygonal", xrange = c(556681.496972543, : 1 illegal points also plotted Earlier it has also shown me the following error: Warning…
BKS
  • 141
  • 1
  • 10
1
vote
0 answers

categorize coordinates in R

I was wondering if the marks command inside the spatstat package could be used with categorical variables instead of continous ones. I have an xlsx table (A2N) with three columns: Size (categoric), CoordX(numeric) and CoordY(numeric). Here is the…
epmc
  • 11
  • 1
1
vote
2 answers

Can I convert kernel density plots to raster and then overlay them using map algebra?

I am currently exploring three shapefiles, each with point data, and all confined to the same window. I also have them in ppp format which I've used to create kernel density maps. plot(density.ppp(smktppp, 0.5, edge=T), main="Supermarket…
1
vote
1 answer

Spatstat, using the which.marks argument

I have a point pattern that has marks. It was created using the connected.ppp function, also in the spatstat package. I want to plot only the points with marks equal to 2. I thought that to do this, the which.marks argument needed to be used,…
bgrantham
  • 281
  • 4
  • 12
1
vote
1 answer

Polygon and line input for point output (in R)

I'd like to create a a .shp file or data table of coordinates where the output point features are where line endpoints touch at a point on the polygon boundary and where lines cross polygon boundaries. No points are generated in the output where…
1
vote
1 answer

Issue of large average intensity values while creating point pattern from a data frame using Spatstat in R

I am using the Spatstat package in R for spatial point analysis. My dataset comprises location coordinates i.e. latitude and longitude of some event upto 6 places of decimal. It has some 9898 observations. Here`s the output of the summary for the…
brock
  • 181
  • 2
  • 10
1
vote
1 answer

Point pattern similarity and comparison

I recently started to work with a huge dataset, provided by medical emergency service. I have cca 25.000 spatial points of incidents. I am searching books and internet for quite some time and am getting more and more confused about what to do and…
JerT
  • 21
  • 3
1
vote
1 answer

Plot in Flipped Java Coordinates

I would like to plot a ppp object from a particle analysis in ImageJ from a greyscale image with size imageSizeX, imageSizeY of point objects Particles$X, Particles$Y in flipped Java coordinates (y0 = top-left). I have a kind of working solution…
Marcel
  • 502
  • 3
  • 11
1
vote
2 answers

Simulation-based hypothesis testing on spatial point pattern hyperframes using "envelope" function in spatstat

I want to use replicated spatial point patterns to perform hypothesis tests in spatstat. spatstat has wonderful documentation, and you can find details about replicated point pattern analysis here:…
A. Brown
  • 31
  • 4
1
vote
1 answer

How to deal with temporal correlation/trend in mppm

Good day, I have been working through Baddeley et al. 2015 to fit a point process model to several point patterns using mppm {spatstat}. My point patterns are annual count data of large herbivores (i.e. point localities (x, y) of male/female…
Sands
  • 25
  • 5
1
vote
1 answer

Conversion of an image to a geotiff using R

I started out with a shape file of points data. I then converted this format to ppp format to use some spatstat functions. The code to do this is listed below: sp_points_df_al <- rgdal::readOGR(dsn = shape_path, layer = "aland_points") # convert…
markthekoala
  • 1,065
  • 1
  • 11
  • 24
1
vote
1 answer

Line density with R and spatstat

I use R and the spatstat package to create a density map of vessels' trajectories using the pixellate function (spatstat). I'm able to create a map and plot the trajectories density. Now I would like to improve the design of my map and do something…
Arnaud Geotribu
  • 919
  • 4
  • 11
  • 22
1
vote
2 answers

Find nearest neighbour of points with the same value when comparing 2 different data sets in R

I have 2 data frames (df1 and df2) that consist of three columns; x co-ordinate, y co-ordinate, category (with 5 levels A-E). So I essentially have 2 sets of points data with each point being assigned to a category e.g. X Y Cat 1 1.5 A 2 …
J. Cee
  • 49
  • 5