在R

时间:2018-11-11 12:11:09

标签: r ggplot2

我仍然不太会说这些问题,对此感到抱歉。我正在寻找有关如何对数据进行子集分析以分析数据中的峰并绘制峰的平均模式的建议,特别是与type =“ m1”中的峰相比。如果现在要绘制数据,它将显示出无数的峰,“ m1”中的峰会显着影响其他类型的峰。峰出现在“杂物”列中,“世代”列是形成峰的x轴。

Mut
# A tibble: 35,742 x 3
# Groups:   Generations [4,001]
  Generations type      Hetero
        <dbl> <fct>      <dbl>
1        2000 m10   0.0000682 
2        2000 m11   0.00000995
3        2000 m2    0.000743  
4        2000 m3    0.000518  
5        2000 m4    0.000185  
6        2000 m5    0.000616  
7        2000 m6    0.0000683 
8        2000 m7    0.00000498
9        2000 m8    0.0000294 
10        2000 m9    0.0000149 
# ... with 35,732 more rows
> 

次优的选择是找到“ m1”的杂项与其他每种类型之间的相关性。 我真正想要的是每个组在m1出现峰值之前和之后的整个曲线。

structure(list(Generations = c(2000, 2000, 2000, 2000, 2000, 
2000, 2000, 2000, 2000, 2000, 2001, 2001, 2001, 2001, 2001, 2001, 
2001, 2001, 2001, 2001, 2002, 2002, 2002, 2002, 2002, 2002, 2002, 
2002, 2002, 2003), type = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 
7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 
3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L), .Label = c("m10", "m11", 
"m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m1"), class = "factor"),         
Hetero = c(6.825e-05, 9.95e-06, 0.000742725, 0.0005181, 0.000185375, 
0.000615925, 6.83e-05, 4.975e-06, 2.935e-05, 1.4925e-05, 
3.94e-05, 9.9e-06, 0.000749025, 0.0005311, 0.00017085, 0.000629025, 
6.835e-05, 9.9e-06, 3.3775e-05, 1.4875e-05, 5.4125e-05, 0.000720775, 
0.000559525, 0.0001716, 0.000576175, 5.3875e-05, 4.975e-06, 
6.0775e-05, 4.975e-06, 4.91e-05)), row.names = c(NA, -30L
), class = c("grouped_df", "tbl_df", "tbl", "data.frame"), vars = 
"Generations", drop = TRUE, indices = list(
0:9, 10:19, 20:28, 29L), group_sizes = c(10L, 10L, 9L, 1L
), biggest_group_size = 10L, labels = structure(list(Generations = c(2000, 
2001, 2002, 2003)), row.names = c(NA, -4L), class = "data.frame", vars = 
"Generations", drop = TRUE))

所以这是一个示例,可以帮助可视化我要寻找的内容,我希望此图中红线中每个峰之间的蓝线平均模式:

enter image description here

0 个答案:

没有答案