as.ppp(spatstat)
as.ppp()所属R语言包:spatstat
Convert Data To Class ppp
将数据转换为类PPP
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Tries to coerce any reasonable kind of data to a point pattern (an object of class "ppp") for use by the spatstat package).
,试图强制任何合理的数据类型,点模式(类的一个对象"ppp")使用spatstat包)。
用法----------Usage----------
as.ppp(X, ..., fatal=TRUE)
## S3 method for class 'ppp'
as.ppp(X, ..., fatal=TRUE)
## S3 method for class 'psp'
as.ppp(X, ..., fatal=TRUE)
## S3 method for class 'quad'
as.ppp(X, ..., fatal=TRUE)
## S3 method for class 'matrix'
as.ppp(X, W=NULL, ..., fatal=TRUE)
## S3 method for class 'data.frame'
as.ppp(X, W=NULL, ..., fatal=TRUE)
## S3 method for class 'influence.ppm'
as.ppp(X, ...)
## Default S3 method:
as.ppp(X, W=NULL, ..., fatal=TRUE)
参数----------Arguments----------
参数:X
Data which will be converted into a point pattern
的数据将被转换成一个点图案
参数:W
Data which define a window for the pattern when X does not contain a window
定义一个窗口用于图案,当X不包含一个窗口的数据
参数:...
Ignored.
忽略。
参数:fatal
Logical value. See Details.
逻辑值。查看详细信息。
Details
详细信息----------Details----------
Converts the dataset X to a point pattern (an object of class "ppp"; see ppp.object for an overview).
转换的数据集X点模式(类的一个对象"ppp";看到ppp.object的概述)。
This function is normally used to convert an existing point pattern dataset, stored in another format, to the "ppp" format. To create a new point pattern from raw data such as x,y coordinates, it is normally easier to use the creator function ppp.
此功能通常用于转换现有的模式数据集,存储在另一种格式,"ppp"格式。要创建一个新的模式从原始数据,如x,y坐标点,它通常是更容易,使用creator功能ppp。
The dataset X may be:
的数据集X可能是:
an object of class "ppp"
一个对象的类"ppp"
an object of class "psp"
一个对象的类"psp"
an object of class "spp" as defined in the spatial library
的对象的类"spp"的spatial库中定义的
an object of class "quad" representing a quadrature scheme (see quad.object)
类的一个对象"quad"正交计划(见quad.object)
a matrix or data frame with at least two columns
至少有两列的矩阵或数据框与
a structure with entries x, y which are numeric vectors of equal length
项目的结构与x,y这是数字向量的长度相等
a numeric vector of length 2, interpreted as the coordinates of a single point.
一个数值向量长度为2,解释为一个单一的点的坐标。
In the last three cases, we need the second argument W which is converted to a window object by the function as.owin. In the first four cases, W will be ignored.
在过去的三年中,我们需要第二个参数W转换为一个窗口对象的功能as.owin。在第一宗情况,W会被忽略。
If X is a line segment pattern (an object of class psp) the point pattern returned consists of the endpoints of the segments. If X is marked then the point pattern returned will also be marked, the mark associated with a point being the mark of the segment of which that point was an endpoint.
如果X是线段模式(类的一个对象psp)返回点模式由线段的端点。如果X被标记,然后返回点模式也将被标记,该标记与一个点的段的标记,其中,该点是一个端点相关联。
If X is a matrix or data frame, the first and second columns will be interpreted as the x and y coordinates respectively. Any additional columns will be interpreted as marks.
如果X是一个矩阵或数据框,第一列和第二列将被解释为x和y坐标分别。任何额外的列将被解释为标记。
The argument fatal indicates what to do when W is missing and X contains no information about the window. If fatal=TRUE, a fatal error will be generated; if fatal=FALSE, the value NULL is returned.
参数fatal表示该怎么办时W丢失和X不包含任何信息的窗口。如果fatal=TRUE,这将产生一个致命的错误,如果fatal=FALSE,值NULL返回。
An spp object is the representation of a point pattern in the spatial library. Our implementation recognises the following formats:
spp对象是一个点模式在spatial库中的代表性。我们的实现识别以下格式:
a structure with entries x, y xl, xu, yl, yu
项目的结构与x,yxl,xu,yl,yu
a structure with entries x, y and area, where area is a structure with entries xl, xu, yl, yu
项目的结构与x,y和area,其中area是一个结构的条目xl,xu,yl ,yu
(used in spatial versions 1 to 6 and version 7.1 respectively) where x and y are vectors of equal length giving the point coordinates, and xl, xu, yl, yu are numbers giving the dimensions of a rectangular window.
(spatial1至6版本和7.1版本分别使用)x和,y是给点坐标向量的长度相等,xl,xu ,yl,yu是数字给一个矩形窗口的尺寸。
The function as.ppp is generic, with methods for the classes "ppp", "psp", "quad", "matrix", "data.frame" and a default method.
函数as.ppp是通用的,"ppp","psp","quad","matrix","data.frame"和一个默认的方法的类的方法。
Point pattern datasets can also be created by the function ppp.
点模式也可以创建数据集的功能ppp。
值----------Value----------
An object of class "ppp" (see ppp.object) describing the point pattern and its window of observation. The value NULL may also be returned; see Details.
类的一个对象"ppp"(见ppp.object)描述观察点模式和它的窗口。值NULL还可以返回,查看详细信息。
警告----------Warnings----------
If the format of spp objects is changed in future versions of the spatial library, then as.ppp may not be able to interpret them. It currently handles all versions of spatial up to 7.1-4.
如果spp对象的格式改变未来版本的spatial库,那么as.ppp可能不能够解释它们。目前,它处理的所有版本的spatial高达7.1-4。
(作者)----------Author(s)----------
Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
and Rolf Turner
<a href="mailto:r.turner@auckland.ac.nz">r.turner@auckland.ac.nz</a>
参见----------See Also----------
ppp, ppp.object, as.owin, owin.object
ppp,ppp.object,as.owin,owin.object
实例----------Examples----------
xy <- matrix(runif(40), ncol=2)
pp <- as.ppp(xy, c(0,1,0,1))
# Venables-Ripley format[维纳布尔斯里普利格式]
# check for 'spatial' package[空间包检查]
spatialpath <- .find.package("spatial", quiet=TRUE)
if(length(spatialpath) != 0) {
require(spatial)
towns <- ppinit("towns.dat")
pp <- as.ppp(towns) # converted to our format[我们的格式转换为]
detach(package:spatial)
}
xyzt <- matrix(runif(40), ncol=4)
Z <- as.ppp(xyzt, square(1))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|