featurePlot R 显示 NULL

featurePlot R displaying NULL

我正在尝试绘制覆盖密度图,但它一直返回 NULL。我在创建椭圆图时遇到了同样的问题,但在安装包后它就可以工作了。知道我在这里遗漏了什么吗?

featurePlot(x = data[, 1:4], 
            y = iris$diabetes,
            plot = "density", 
            scales = list(x = list(relation="free"), 
                          y = list(relation="free")),
            auto.key = list(columns = 3))```

如果你在谈论鸢尾花数据集,那么它应该是:

library(caret)

featurePlot(x = iris[, 1:4], 
            y = iris$Species,
            plot = "density", 
            scales = list(x = list(relation="free"), 
                          y = list(relation="free")),
            auto.key = list(columns = 3))