Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [spatstat]

spatstat is a package for the statistical software suite R to conduct spatial point pattern analysis and modeling

0
votes
0answers
22 views

Converting line vector layer to raster with pixellate.psp creating missing data?

The following example converts a line vector layer (road network) into a density raster. It seems to be working for others, but it looks like it's creating data gaps at my resolution (50m). library(...
1
vote
1answer
45 views

Adjusting resolution of spatstat::pixellate.psp() output

I am trying to accomplish exactly what is being done in this question: Convert line shapefile to raster, value=total length of lines within cell using spatstat::pixellate.psp() technique (see third ...
1
vote
1answer
84 views

Kernel Density Map points rejected as outside window

I am trying to make a kernel density plot of a points shapefile like so: library(rgdal) library(spatstat) library(maptools) points <- readOGR(dsn = "C:\\Documents", layer = "...
2
votes
0answers
49 views

One-dimensional data in spatstat

I have data of one-dimensional points (locations in a straight line). I want to check if the cluster poisson process models or Cox models are a good fit for the data. Since my data only has x-...
0
votes
1answer
171 views

How to have a Raster output of a ppm model in spastat

I am trying to compare the outputs of species distribution models. My current code uses the following function to calculate TSS scores. TSS_Score<-function(TrueBinary, Raster) { Raster[]<-...
1
vote
2answers
56 views

Error in pairdist calculation

I'm trying to calculate pair distances among the points of my dataset. I have point in EPSG:3857. This is the code I ran: I import the data, then: coordinates(datPb) <- c("X","Y") proj4string(...
3
votes
1answer
919 views

Removing frame/plot borders from plot.im output

I am plotting point density using the plot.im command in spatstat, and my output always has a frame around the plotted image that becomes thicker when I increase resolution for export. I tried frame=F,...
0
votes
1answer
530 views

Creating polygonal windows for spatial analysis in r

I am attempting to normalize a spatial point pattern using a population density raster in r. My problem is that the function I am trying to run is recognizing the "white space" around the raster I am ...
12
votes
1answer
3k views

Calculating road density in R using kernel density? [closed]

I have a large (~70MB) shapefile of roads and want to convert this to a raster with road density in each cell. Ideally I'd like to do this in R along with GDAL command line tools if necessary. My ...
0
votes
1answer
353 views

Adding 'marks' to point file in spatstat?

Using help on this site I have already got the following code from where I can perform certain analyses. However, I'd now like to perform analyses on a certain variable (column z) within the point ...
3
votes
1answer
465 views

Adding point shapefile layer to polygon shapefile window in R?

I'm new to Spatstat for R and I'm trying to add a point layer to a window I've created from a polygon. I see questions like this have been asked before but I still can't get what I need from the ...
1
vote
0answers
175 views

using distmap() and ppp() in spatstat package

I have about 6000 long/lat points representing the location of health centers in the US. I want to color a map of the US according to the distance to the nearest health center. On my last post, I ...
1
vote
2answers
1k views

R package spatstat: How to use point process model covariate as factor when pixel image values are numeric

I am trying to model a point process with an image covariate using the ppm() function in the spatstat package in R. I convert my raster to an im object for use with spatstat, and I run into a problem ...
1
vote
3answers
2k views

Converting raster to im object for point process model covariate in R?

I am trying to convert a raster object to an .im object for use with a point process model in the spatstat package in R. I begin by creating the raster from a tiff file using the raster() package. No ...
1
vote
1answer
2k views

How to find highest kernel density point

I've been using spatstat to analyse point patterns in R. Here's an example to put this in context: library(spatstat) library(maptools) # to convert sp class to ppp Some point data: set.seed(1985) x ...
0
votes
1answer
2k views

How can I connect my point pattern shapefile with my polygon window in R?

I would like to do some spatial statistics in R. I have a point layer called '1983' that represents the distribution of one species, and a polygon layer called 'SA-R' that represents the study area. ...
3
votes
0answers
675 views

python equivalent of spatstat's spatial point process functions

Is there a free python package (i.e. PySAL?) that implements the standard summary statistics for spatial point processes, e.g. the F, G, J, and K functions? I'm happy to use R (i.e. spatstat) if ...
2
votes
1answer
2k views

R - Crop a pixel image produced by spatstat with a boundary shape

i am using the very good spatial statistic package spatstat to produce probability maps of spatial point patterns. Here is a simple working result from the examples to try out. require(spatstat) ...
12
votes
3answers
5k views

How to get the second nearest neighbor between two point patterns in R?

Is there a way to get the distances for the second nearest neighbor between two point patterns in R? The spatstat package has a function called nncross but it only applies to the nearest neighbors ...
22
votes
3answers
5k views

Using R with ArcGIS Desktop?

I've used the integration of R with QGIS, and found it a very uesful tool. Having taken a look at the R toolbox extension for 9 and the extension for 10 it appears they both offer only point ...