I have a dataframe whoese strucuture is like this:
> 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 ...
I have plotted a accumulation density figure based on this dataframe:
p <- ggplot(mydata12, aes(x = intron_length, color=intron_type)) + geom_step(aes(y=..y..),stat="ecdf")
Now I want to make the comparison by adding p values among 3 groups:
> 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
I guess I need to set a value on x axis to make comparison, my question is how to set the x axix value and add the p value?
Thanks,