spatstat中的单位长度 [英] Unit length in spatstat

查看:128
本文介绍了spatstat中的单位长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Spatstat中的KEST函数有一个非常简单的问题. KEST图形输出我正在使用Spatstat中的KEST函数来评估数据集中的空间随机性.我使用ripras函数指定空间域,上传了散布在伦敦的经度和纬度值,并将其转换为PPP对象.当我在ppp上运行KEST分析并绘制图形时,最终在x上得到r值,但是尽管我知道这是一种距离测量,但我不知道它使用的单位.我得到以下摘要输出:

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 points per square unit
Coordinates are given to 9 decimal places
Window: polygonal boundary
single connected closed polygon with 14 vertices
enclosing rectangle: [-0.5532963, 0.3519148] x [51.2901, 51.7022] units
Window area = 0.277003 square units

,其中x轴上的max r为0.1个单位,y轴上的K(r)为0.04.我如何找出这些距离等于什么距离单位?

with the max r on the x axis being 0.1 units, and the K(r) on the y axis being 0.04. How do I figure out what unit of distance these equate to?

推荐答案

您的经纬度坐标对应于用作地球模型的球体(或椭圆体或其他物体)上的点.本质上,spatstat假定您正在使用在平面地图上投影的坐标.这种转换可以通过例如sp程序包(以白金汉宫为例):

Your lat,lon coordinates correspond to points on a sphere (or ellipsoid or whatever) used as a model for planet Earth. Essentially, spatstat assumes you are using coordinates projected on a flat map. This conversion could be done with e.g. the sp package (using Buckingham Palace as an example):

library(sp)
lat = c(51.501476)
lon = c(-0.140634)
xy = data.frame(lon, lat)
coordinates(xy) <- c("lon", "lat")
proj4string(xy) <- CRS("+proj=longlat +datum=WGS84")
NE <- spTransform(xy, CRS("+proj=utm +zone=30 ellps=WGS84"))
NE <- as.data.frame(NE)

结果为data.frame,其投影坐标在Easting,Northing中以米为单位.然后,您可以从那里继续进行分析.要将像"m"这样的单位标签分配给图中的漂亮标签,请在ppp对象上使用函数unitname(假设该对象称为X):unitname(X) <- "m"

The result is a data.frame with projected coordinates in Easting, Northing in metres. Then you can continue your analysis from there. To assign a unit label like "m" for prettier labels in figures use the function unitname on your ppp object (assuming the object is called X): unitname(X) <- "m"

这篇关于spatstat中的单位长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆