找回密码
 注册
查看: 360|回复: 0

R语言 spdep包 knn2nb()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 14:39:43 | 显示全部楼层 |阅读模式
knn2nb(spdep)
knn2nb()所属R语言包:spdep

                                        Neighbours list from knn object
                                         邻居KNN对象列表

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

The function converts a knn object returned by knearneigh  into a neighbours list of class nb with a list of integer vectors  containing neighbour region number ids.
该函数将一个knn返回knearneigh成一个邻居列表类的对象nb的列表包含邻域数IDS的整数向量。


用法----------Usage----------


knn2nb(knn, row.names = NULL, sym = FALSE)



参数----------Arguments----------

参数:knn
A knn object returned by knearneigh
一个KNN对象返回的knearneigh


参数:row.names
character vector of region ids to be added to the neighbours list as attribute region.id, default seq(1, nrow(x))
字符区域的id被添加到向量的邻居列表的属性region.id,默认seq(1, nrow(x))


参数:sym
force the output neighbours list to symmetry
强制输出对称邻居列表


值----------Value----------

The function returns an object of class nb with a list of integer vectors containing neighbour region number ids. See card for details of “nb” objects.
该函数返回一个类的对象nb的列表包含邻域数IDS的整数向量。见card的“NB”对象的详细信息。


(作者)----------Author(s)----------


Roger Bivand <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>



参见----------See Also----------

knearneigh, card
knearneigh,card


实例----------Examples----------


example(columbus)
coords <- coordinates(columbus)
col.knn <- knearneigh(coords, k=4)
plot(columbus, border="grey")
plot(knn2nb(col.knn), coords, add=TRUE)
title(main="K nearest neighbours, k = 4")

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-18 02:34 , Processed in 0.023771 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表