spatstat

Spatstat not available for R 3.2.3

房东的猫 提交于 2020-01-24 13:54:08
问题 I am trying to install the package Spatstat from a CRAN mirror in Germany (Münster) in R version 3.2.3, and it hasn't been possible because the package is not included into the packages list available to be installed. There is a similar question about problems installing this package, but then the problem was an old version of R, which is not my case. Does anybody know why is 'spatstats' not included in the list of packages of my CRAN mirror and how can I solve this problem? Thanks in advance

Analyzing octopus catches with LinearK function in R [closed]

≡放荡痞女 提交于 2019-12-24 00:54:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . I hope you can help me with this problem i can't find how to overcome. Sorry if I made some mistakes while writing this post, my english is a bit rusty right now. Here is the question. I have .shp data that I want to analyze in R. The .shp can be either lines that represent lines of traps we set to catch

Merge two polygon regions into a single polygon region in R

余生长醉 提交于 2019-12-23 15:37:37
问题 I'm new to working with spatial data and polygons in R. I have two separate shape files of two polygons that I extract from Google Earth. So basically the first shape file is a location (such as a shopping mall etc.) and the second shape file is a three kilometre radius around the first location. I read both shape files into R as SpatialPolygonsDataFrames. I use the following code: library(maptools) library(sp) library(spatstat) options(digits=10) # Read polygon a a <- readShapeSpatial(file

Voronoi diagram polygons enclosed in geographic borders

自古美人都是妖i 提交于 2019-12-17 22:50:57
问题 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(

Finding euclidean distance in R{spatstat} between points, confined by an irregular polygon window

懵懂的女人 提交于 2019-12-17 20:25:57
问题 I'm trying to find the euclidean distance between two points, confined by an irregular polygon. (ie. the distance would have to be calculated as a route through the window given) Here is an reproducible example: library(spatstat) #Simple example of a polygon and points. ex.poly <- data.frame(x=c(0,5,5,2.5,0), y=c(0,0,5,2.5,5)) points <- data.frame(x=c(0.5, 2.5, 4.5), y=c(4,1,4)) bound <- owin(poly=data.frame(x=ex.poly$x, y=ex.poly$y)) test.ppp <- ppp(x=points$x, y=points$y, window=bound)

finding point of intersection in R

不打扰是莪最后的温柔 提交于 2019-12-17 05:05:11
问题 I have 2 vectors: set.seed(1) x1 = rnorm(100,0,1) x2 = rnorm(100,1,1) I want to plot these as lines and then find the intersection points of the lines, also if there are multiple points of intersection then I want to locate each of them. I have come across a similar question,and tried to solve this problem using spatstat , but I was not able to convert my combined data frame containing both vector values to psp object . 回答1: If you literally just have two random vectors of numbers, you can

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

删除回忆录丶 提交于 2019-12-13 06:57:17
问题 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 using the im as a covariate in the model. The pixel values are numeric, but these are actually just codes for different landscape zones so the crux of the problem is getting the model to read the pixel values as factor rather than numeric. I have tried the following two approaches (R code and

Issue pasing arguments to kernel functions through `density.ppp`

老子叫甜甜 提交于 2019-12-13 03:23:47
问题 I am currently working intensively with the density.ppp function, calling it with different kernel functions of my own design. For this, I need to pass some arguments through density.ppp to my kernel functions via the ... arglist. There is one case in which this does not work, namely if I want to calculate at = "points" with edge correction. In densitypointsengine it says # evaluate edge correction weights at points if(edge) { win <- x$window if(isgauss && is.null(varcov) && win$type ==

generate clustered spatstat marks?

北慕城南 提交于 2019-12-12 02:39:28
问题 I was wondering if anyone knows how to assign marks in spatstat so that they tend to cluster spatially? I have a set of lat long coordinates that I want to categorize into 4 groups. I have figured out how to randomly assign marks/groups to these points using the following code: as.ppp(data, window ,marks=factor(sample(1:4,replace=TRUE))) But I can't figure out how to assign the marks so that groups tend to occupy points closer to one another. As a further complication, I would also like the

Point Patterns in Spatstat

淺唱寂寞╮ 提交于 2019-12-11 19:42:17
问题 I am having a few problems with creating a point pattern in the R package Spatstat. > HI06mfav <- read.table("MarHI06mfav.txt", header = TRUE) > attach(HI06mfav) The following object(s) are masked _by_ '.GlobalEnv': x, y The following object(s) are masked from 'HI06mfav (position 3)': x, y > HI06mfav.P <- ppp(x, y, c(-1, 11), c(-1, 11)) Warning message: In ppp(x, y, c(-1, 11), c(-1, 11)) : 10 points were rejected as lying outside the specified window > HI06mfav x y 1 4.100800 6.526913 2 3