1

我有以下数据框:

 cost quality safety time    status
1   13       6      3    4 Benchmark
2   10       4      5   10 Benchmark
3    8       9      3    9 Benchmark
4    7       8      9    9 Benchmark
5    4       4      4    2   current
6    2       2      7   11   current

我想根据散点图创建基准空间。所以我使用了 scatterplot3d 包来绘制它。

散点图代码:

scatterplot3d(f$cost,f$quality,f$safety,f$time,f$status)

我得到了下图, 散点图 但我想以 0.975 的置信度为基准绘制椭圆。所以我在汽车包中找到了 dataEllips,但我不知道如何在 scatterplot3d 中应用此函数。我想要的图表如下:

带椭圆的散点图

我已经尝试了下面的代码,但它不起作用;

scatterplot3d(dataEllipse(f$cost,f$quality,levels=0.68),f$safety,f$time,f$status)

因为dataEllips的功能来自car包。错误信息如下:

Error in xyz.coords(x = x, y = y, z = z, xlab = xlabel, ylab = ylabel,  : 
  'x', 'y' and 'z' lengths differ
4

0 回答 0