简体   繁体   English

如何在R中的箱线图中传播点?

[英]How to spread points in boxplot in R?

I am working on data distribution which has following follwing points. 我正在研究数据分布,其中包含以下几点。

input<-read.table("infile",header=TRUE,sep="\\t") 输入<-read.table( “infile中”,首标= TRUE,九月= “\\ t” 的)

table(input) 表(输入)

0.786333        1  1.04453  1.06159  1.33277  1.53607  2.25893 
  49      938        1        1       36       16      166

if i plot box plot for it, i get single line for lowest datum, highest datum and median. 如果我绘制它的盒子图,我得到最低基准,最高基准和中位数的单行。

boxplot(input) 箱线图(输入)

在此输入图像描述

Is there any way to distribute points by normalization so that can have better boxplot with distinct boundary for lowest datum, highest datum and median? 有没有办法通过归一化来分配点,这样可以有更好的箱图,其中最低基准,最高基准和中位数具有明显的边界?

You clearly have a biomodal distribution, I don't think a boxplot is a useful summary here 你明显有一个生物模式分布,我不认为箱形图是一个有用的总结

A density plot is more useful 密度图更有用

plot(density(zz))

在此输入图像描述

You could also consider a violin plot which is a bit of a mix between a kernel density plot and boxplot. 您还可以考虑一个小提琴图 ,这是一个核密度图和箱图之间的混合。

Using the vioplot package 使用vioplot

 library(vioplot)
 violplot(zz)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM