1

我正在尝试使用fviz_ca_col() 来自 package factoextra的对应分析中更改用于补充列的颜色,但是从默认值更改颜色时,我似乎没有得到任何响应col.col.sup = "darkred"。可重现的例子:

library(FactoMineR)
library(factoextra)

# Load example data
data("housetasks")

# Perform correspondence analysis
resca <- CA(housetasks, 
                 col.sup = which(names(housetasks) == "Alternating"),  
                 graph = FALSE)

# Call to plot
fviz_ca_col(resca, col.col.sup = "black")

生成的绘图具有"Alternating"默认深红色的补充列:

在此处输入图像描述

4

1 回答 1

1

源代码中有一个错误:

fviz (X, element = "col", axes = axes, geom = geom.col,
        color = col.col, alpha = alpha.col,
        pointshape = shape.col, select = select.col, 
        map = map, repel = repel, 
        colcol.sup = col.col.sup, shape.sup = shape.col, ...)

输入参数应该col.col.sup =colcol.sup =

一种方法是调用 fviz:

fviz(resca,element="col",col.col.sup="black")

在此处输入图像描述

于 2022-01-03T17:59:23.183 回答