USCA(TSP)
USCA()所属R语言包:TSP
USCA312/USCA50 – 312/50 cities in the US and Canada
USCA312/USCA50 - 312/50个城市,在美国和加拿大
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The USCA312 dataset contains the distances between 312 cities in the US and Canada as an object of class TSP. USCA50 is a subset of USCA312 containing only the first 50 cities.
USCA312数据集包含对象的类TSP在美国和加拿大的312个城市之间的距离。 USCA50是USCA312只包含50个城市的一个子集。
The USCA312_map dataset contains spatial data of the 312 cities.
USCA312_map数据集包含了空间数据的312个城市。
用法----------Usage----------
data("USCA312")
data("USCA312_map")
data("USCA50")
格式----------Format----------
USCA312 and USCA50 are objects of class TSP. USCA312_map contains in USCA312_coords the spatial coordinates of the 312 cities and in USCA312_basemap a part of the map of North America.
USCA312和USCA50是对象类TSP。 USCA312_map包含在USCA312_coords的空间坐标的312个城市,并在USCA312_basemap北美图的一部分。
Details
详细信息----------Details----------
For USCA312_map several packages for geographic data are needed (see Examples section).
USCA312_map几个包的GEO数据(见例一节)。
We want to thank Roger Bivand for his help with plotting the map.
我们要对他的帮助与感谢Bivand罗杰绘制的图。
源----------Source----------
John Burkardt, CITIES – City Distance Datasets, http://www.csit.fsu.edu/~burkardt/datasets/cities/cities.html
约翰·Burkardt,城市 - 城市距离数据集,http://www.csit.fsu.edu/ burkardt /数据集/城市/ cities.html的
实例----------Examples----------
data("USCA312")
data("USCA312_map")
## calculate a tour[#计算旅游]
tour <- solve_TSP(USCA312)
tour
## load map tools[#加载图的工具。]
library("maps")
library("sp")
library("maptools")
## plot map[#图图]
plot(as(USCA312_coords, "Spatial"), axes=TRUE)
plot(USCA312_basemap, add=TRUE, col = "gray")
## plot tour and add cities[#图旅游,增加城市]
tour_line <- SpatialLines(list(Lines(list(
Line(USCA312_coords[c(tour, tour[1]),])), ID="1")))
plot(tour_line, add=TRUE, col = "red")
points(USCA312_coords, pch=3, cex=0.4, col="black")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|