[英]R multiple boxplot visualization
I have data in a csv consisting of more than 4000 entries and a glimpse of the data in it looks like this:我有一个由 4000 多个条目组成的 csv 数据,其中的数据如下所示:
Variant Metric Value
I Accuracy 76.14708
I F-measure 0.87
II Accuracy 76.23548
III Accuracy 76.07839
IV Time 0.56
As the metrics are on a different scale I am unable to get a proper view of the box plots for time and f-measure metrics:由于指标的规模不同,我无法正确查看时间和 f-measure 指标的箱线图:
The R code is as follows: R代码如下:
df <- read.csv("NBboxplot.csv", header=T)
require(ggplot2)
p <- ggplot(data = df, aes(x=Variant, y=Value)) +
geom_boxplot(aes(fill=Metric))
p + facet_wrap( ~ Variant, scales="free")
Any clue towards better visualization?任何关于更好可视化的线索?
I would change the facet to Metric
, as these are on drastically different scales:我会将 facet 更改为
Metric
,因为它们的尺度完全不同:
p <- ggplot(data = df, aes(x=Variant, y=Value)) +
geom_boxplot(aes(fill=Metric)) +
facet_wrap(~Metric, scales="free")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.