Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更改系统图的终端标签-plotBS函数{phangorn package}_R - Fatal编程技术网

更改系统图的终端标签-plotBS函数{phangorn package}

更改系统图的终端标签-plotBS函数{phangorn package},r,R,对于特定的分类群,我想将终端/分类群颜色改为蓝色 我想把“蓬奎特湖”、“安斯利湖”、“黑河”、“平丘湖”和“蓝池”改成蓝色。有办法做到这一点吗 代码(下图): datos未给出任何数据,因此示例不完全可再现。下面使用hclust的一般示例可能会给您一个想法: set.seed(123) x <- matrix(rnorm(100), nrow=20) row.names(x) <- LETTERS[1:20] # first 10 red, next 10 blue colors

对于特定的分类群,我想将终端/分类群颜色改为蓝色

我想把“蓬奎特湖”、“安斯利湖”、“黑河”、“平丘湖”和“蓝池”改成蓝色。有办法做到这一点吗

代码(下图):


datos未给出任何数据,因此示例不完全可再现。下面使用
hclust
的一般示例可能会给您一个想法:

set.seed(123)
x <- matrix(rnorm(100), nrow=20)
row.names(x) <- LETTERS[1:20]

# first 10 red, next 10 blue
colors <- rep(c("red", "blue"), each=10)

hc <- hclust(dist(x))
plot(as.dendrogram(hc), horiz = TRUE, leaflab="none")
mtext(hc$labels, at=hc$order, side=4, line=0, col=colors, las=1)
set.seed(123)

x显示数据是向前迈出的一步,但仍然需要手动工作来帮助您。请进行转储,并包括结果:
dump(datos)
I get:Error in FUN(X[[I]],…):无效的第一个参数抱歉,我的错误,请使用
dput(datos)
set.seed(123)
x <- matrix(rnorm(100), nrow=20)
row.names(x) <- LETTERS[1:20]

# first 10 red, next 10 blue
colors <- rep(c("red", "blue"), each=10)

hc <- hclust(dist(x))
plot(as.dendrogram(hc), horiz = TRUE, leaflab="none")
mtext(hc$labels, at=hc$order, side=4, line=0, col=colors, las=1)