0

我正在尝试在数据帧上运行 R 中的因子分析混合数据并使用以下命令:

res.famd <- FAMD(df, graph = FALSE)

但我收到以下错误:

错误其中(unlist(lapply(listModa,is.numeric))):'which'的参数不合逻辑

我检查了:

str(df)

我得到以下信息:

性别 : chr "M" "M" "M" "M" ...
组 : chr "LOW" "LOW" "LOW" "LOW" ...
A : num 3.86e-09 1.90e-091.86e-09 3.63e-09 1.73e-09 ...
B:编号 2.32e-05 5.69e-06 1.86e-05 1.45e-05 1.04e-05 ...
C:编号 0.00249 0.00385 0.01555 0.00853 0.00426 ...

我正在尝试将变量转换为因子,但不确定是否需要这样做。我正在关注下面的链接,它说 FAMD 可以使用字符和数字变量: http: //www.sthda.com/english/articles/31-principal-component-methods-in-r-practical-guide/115 -famd-要素分析-混合数据在-r-essentials/

4

1 回答 1

0

您是否尝试过将 char 变量转换为因子。

IE

df$Gender<- as.factor(df$Gender)
df$Group<- as.factor(df$Group)
于 2017-12-28T20:47:42.420 回答