lonlat2xy(spectralGP)
lonlat2xy()所属R语言包:spectralGP
Projects lon/lat coordinates to x/y Euclidean coordinate system
项目经度/纬度坐标的x / y欧几里得坐标系统
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The projection calculates, for all points, the great circle distance in the x direction to the mean longitude and in the y direction to the mean latitude, and uses these distances as the x-y coordinates of the location. This function is copied from the fields library.
投影计算,可用于所有的点,在x方向上的距离的平均经度大圆和在y方向上的平均纬度,作为xy坐标的位置,并使用这些距离。这个功能是从库中复制。
用法----------Usage----------
lonlat2xy(lnlt,miles=FALSE)
参数----------Arguments----------
参数:lnlt
A two-column matrix-like object of lon/lat coordinates to be projected, with longitude in the first column.
两列的矩阵状的对象的经度/纬度坐标以被投射,在第一列中的经度。
参数:miles
Indicator of whether distances should be calculated in miles or kilometers (FALSE, the default).
距离应否计算在英里或公里(FALSE,默认值)指标。
Details
详细信息----------Details----------
Note that this is an ad hoc projection best used only for small portions of the globe.
请注意,这是一个特设的投影最好只用于全球的一小部分。
值----------Value----------
A two-column matrix of projected x/y coordinates, with the x-coordinate in the first column.
投影的x / y坐标,在第一列中的x坐标的两列的矩阵。
(作者)----------Author(s)----------
copied from the fields library by Christopher Paciorek <a href="mailto:paciorek@alumni.cmu.edu">paciorek@alumni.cmu.edu</a>
参见----------See Also----------
xy2unit, new.mapping
xy2unit,new.mapping
实例----------Examples----------
library(spectralGP)
gp1=gp(c(128,128),matern.specdens,c(1,4))
n=100
locs=cbind(runif(n,20,80),runif(n,40,50))
locs.predict=cbind(runif(n,30,90),runif(n,38,48))
locs=lonlat2xy(locs)
locs.predict=lonlat2xy(locs.predict)
scaled.locs=xy2unit(locs,rbind(locs,locs.predict))
scaled.locs.predict=xy2unit(locs.predict,rbind(locs,locs.predict))
train.map=new.mapping(gp1,scaled.locs)
predict.map=new.mapping(gp1,scaled.locs.predict)
plot(locs,xlim=c(min(locs[,1],locs.predict[,1]),max(locs[,1],
locs.predict[,1])),ylim=c(min(locs[,2],locs.predict[,2]),
max(locs[,2],locs.predict[,2])))
points(locs.predict,col=2)
plot(scaled.locs,xlim=c(0,1),ylim=c(0,1))
points(scaled.locs.predict,col=2)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|