spatstat

How to generate a list of segments from a list of random self-intercepting lines (psp in R)?

拜拜、爱过 提交于 2019-12-11 15:03:56
问题 I'm using X=rpoisline(4) to generate lines and plot them with plot(X) . With X$ends I have their coordinates and their intersection points with selfcrossing.psp(X) (In R with spatstat : library(spatstat) ). I need to get a list of segments and their coordinates and be able to manipulate them (change their orientation, position, intersection...). Those segments have to be defined by the intersection of a line with an other line and with the window. So, am I missing a simple way to convert a

How can I include survey weights in a poisson pint process model fitted to a logistic regression quadrature scheme?

ε祈祈猫儿з 提交于 2019-12-11 14:37:08
问题 Is it possible to include weights in a poisson point process model fitted to a logistic regression quadrature scheme? My data is a stratified sample and I would like to account for this sampling strategy in order to have valid population level predictions. 回答1: Here are a few lines to elaborate on the answer by @adrian-baddeley. If you have the setup of your related question and we imagine you have the weights and two covariates in a data.frame in the same order as the points of your

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

回眸只為那壹抹淺笑 提交于 2019-12-11 06:15:19
问题 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 Density") plot(density.ppp(tptppp, 0.5, edge=T), main="Transport Density") plot(density.ppp(farmppp, 0.5, edge=T), main="Urban Farm Density") I would like to overlay these plots, using map algebra, or fuzzy logic, etc, to create one output map showing the

directional testing of spatial clustering by distance from source

試著忘記壹切 提交于 2019-12-07 14:56:04
问题 I have a spatial dataset of animal locations, as (x,y) points around a source (circular pattern with 5 km radius). I need to test whether the points are clustered (or repulsed) around the source relative to farther from the source, while accounting for directionality. Things I tried: checked out nearest neighbour and Ripley's K - could not figure out how to incorporate distance from source or directionality (plus, it looks like Ripley's is expecting a rectangular window, whereas mine is

directional testing of spatial clustering by distance from source

别来无恙 提交于 2019-12-05 21:57:33
I have a spatial dataset of animal locations, as (x,y) points around a source (circular pattern with 5 km radius). I need to test whether the points are clustered (or repulsed) around the source relative to farther from the source, while accounting for directionality. Things I tried: checked out nearest neighbour and Ripley's K - could not figure out how to incorporate distance from source or directionality (plus, it looks like Ripley's is expecting a rectangular window, whereas mine is circular) divided data into cardinal directions (N, E, S, W) and distance bins and calculated density of

Unit length in spatstat

六月ゝ 毕业季﹏ 提交于 2019-12-04 06:28:02
问题 I have what may be a very simplistic question on the KEST function in Spatstat.KEST graph output I'm using the KEST function in Spatstat to assess spatial randomness in a dataset. I have uploaded lat and long values spread over London and converted them to a PPP object, using the ripras function to specify the spatial domain. When I run my KEST analysis on my ppp, and plot the graph, I end up with an r value on the x, but although I know this is a distance measurement, I don't know what units

Unit length in spatstat

只愿长相守 提交于 2019-12-02 09:56:24
I have what may be a very simplistic question on the KEST function in Spatstat. KEST graph output I'm using the KEST function in Spatstat to assess spatial randomness in a dataset. I have uploaded lat and long values spread over London and converted them to a PPP object, using the ripras function to specify the spatial domain. When I run my KEST analysis on my ppp, and plot the graph, I end up with an r value on the x, but although I know this is a distance measurement, I don't know what units it's using. I get this summary output: Planar point pattern: 113 points Average intensity 407.9378

plotting and coloring data on irregular grid

帅比萌擦擦* 提交于 2019-11-30 02:23:14
I have data in the form (x, y, z) where x and y are not on a regular grid. I wish to display a 2D colormap of these data, with intensity (say, grey scale) mapped to the z variable. An obvious solution is to interpolate (see below) on a regular grid, d <- data.frame(x=runif(1e3, 0, 30), y=runif(1e3, 0, 30)) d$z = (d$x - 15)^2 + (d$y - 15)^2 library(akima) d2 <- with(d, interp(x, y, z, xo=seq(0, 30, length = 30), yo=seq(0, 30, length = 50), duplicate="mean")) pal1 <- grey(seq(0,1,leng=500)) with(d2, image(sort(x), sort(y), z, useRaster=TRUE, col = pal1)) points(d$x, d$y, col="white", bg=grey(d$z

plotting and coloring data on irregular grid

痴心易碎 提交于 2019-11-28 23:14:22
问题 I have data in the form (x, y, z) where x and y are not on a regular grid. I wish to display a 2D colormap of these data, with intensity (say, grey scale) mapped to the z variable. An obvious solution is to interpolate (see below) on a regular grid, d <- data.frame(x=runif(1e3, 0, 30), y=runif(1e3, 0, 30)) d$z = (d$x - 15)^2 + (d$y - 15)^2 library(akima) d2 <- with(d, interp(x, y, z, xo=seq(0, 30, length = 30), yo=seq(0, 30, length = 50), duplicate="mean")) pal1 <- grey(seq(0,1,leng=500))

Voronoi diagram polygons enclosed in geographic borders

人走茶凉 提交于 2019-11-28 20:46:38
I am trying to create Voronoi polygons (aka Dirichlet tessellations or Thiessen polygons) within a fixed geographic region for a set of points. However, I am having trouble finding a method in R that will bound the polygons within the map borders. My main goal is to get accurate area calculations (not simply to produce a visual plot). For example, the following visually communicates what I'm trying to achieve: library(maps) library(deldir) data(countyMapEnv) counties <- map('county', c('maryland,carroll','maryland,frederick', 'maryland,montgomery', 'maryland,howard'), interior=FALSE) x <- c(