我有一个结构如下的数据框:
> str(mydata12)
'data.frame': 228459 obs. of 2 variables:
$ intron_length: num 0.787 0.799 2.311 2.396 1.77 ...
$ intron_type : Factor w/ 3 levels "All_intron","All_retained_intron",..: 1 1 1 1 1 1 1 1 1 1 ...
我已经根据这个数据框绘制了一个累积密度图:
p <- ggplot(mydata12, aes(x = intron_length, color=intron_type)) + geom_step(aes(y=..y..),stat="ecdf")
现在我想通过在 3 个组中添加 p 值来进行比较:
> compare_means(intron_length~intron_type, data = mydata12)
> my_comparisons <- list(c("All_intron", "All_retained_intron"), c("All_intron", "dynamic_intron"), c("All_retained_intron", "dynamic_intron"))
> p + stat_compare_means(comparisons = my_comparisons)
Error in f(...) :
Can only handle data with groups that are plotted on the x-axis
我想我需要在 x 轴上设置一个值来进行比较,我的问题是如何设置 x 轴值并添加 p 值?
谢谢,