path_dist(tourr)
path_dist()所属R语言包:tourr
Compute distance matrix from bases.
计算距离矩阵的碱基。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Compute distance matrix from bases.
计算距离矩阵的碱基。
用法----------Usage----------
path_dist(history)
参数----------Arguments----------
参数:history
history of the plots
历史的图
实例----------Examples----------
## Not run: [#不运行:]
grand <- interpolate(save_history(flea[, 1:6], max = 50), 0.2)
# The grand tour -----------------------------[大旅游-----------------------------]
# Look at the tour path in a tour, how well does it cover a sphere[在游览游览路径的,以及它如何覆盖领域]
# Using MDS[使用MDS]
d <- path_dist(grand)
ord <- as.data.frame(MASS::isoMDS(d)$points)
qplot(V1, V2, data = ord, geom="path") +
coord_equal() + labs(x = NULL, y = NULL)
library(rggobi)
# Using a tour in ggobi[使用一个在ggobi之旅]
x<-t(rbind(grand[,1,])); colnames(x)<-c("a11","a21","a31","a41","a51","a61")
y<-t(rbind(grand[,2,])); colnames(x)<-c("a12","a22","a32","a42","a52","a62")
z<-cbind(x,y)
ggobi(z)
## End(Not run)[#(不执行)]
# 5 guided tours -----------------------------[5个导游-----------------------------]
holes1d <- guided_tour(holes, 1)
tries <- replicate(5, save_history(flea[, 1:6], holes1d, max = 10),
simplify = FALSE)
tries2 <- lapply(tries, interpolate, 0.2)
bases <- unlist(lapply(tries2, as.list), recursive = FALSE)
class(bases) <- "history_list"
index_values <- paths_index(tries2, holes)
d <- path_dist(bases)
ord <- as.data.frame(cmdscale(d, 2))
info <- cbind(ord, index_values)
if (require("ggplot2")) {
qplot(step, value, data = info, geom="line", group = try)
qplot(V1, V2, data = info, geom="path", group = try) +
geom_point(aes(size = value)) +
coord_equal()
last_plot() + facet_wrap(~ try)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|