Boxplot只显示扁线

问题描述 投票:0回答:1

我有以下矩阵:

test <- matrix(c(2006,100,
                 2007,105,
                 2008,98,
                 2009,102,
                 2010,107),ncol=2,byrow=TRUE)

我想绘制它的箱形图

boxplot.matrix(test)

但是,我只得到两条扁平线:enter image description here

我无法确定我做错了什么。可能是什么问题呢?

r matrix boxplot
1个回答
2
投票

如果检查数据的性质,您将看到有两组相距很远但在每组内,数据点非常接近。

由于聚类和缩放,您的数据将以它们的方式显示。

如果您分别检查每一列,您将得到一个“典型”框图

> boxplot(test[,1], main="boxplot of column 1")

column1 data

> boxplot(test[,2], main="boxplot of column 2")

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.