这是一个 Dataframe ,对每个结果变量进行了三次重复比较(因此子多级为12)
A tibble: 36 x 10
s .y. group1 group2 n1 n2 p p.signif p.adj p.adj.signif
* <chr> <chr> <chr> <chr> <int> <int> <dbl> <chr> <dbl> <chr>
1 E value new_value_for_8 new_value_for_6 25 25 0.877 ns 1 ns
2 E value new_value_for_8 new_value_for_4 25 25 0.929 ns 1 ns
3 E value new_value_for_6 new_value_for_4 25 25 0.948 ns 1 ns
4 F value new_value_for_8 new_value_for_6 25 25 0.735 ns 1 ns
5 F value new_value_for_8 new_value_for_4 25 25 0.738 ns 1 ns
6 F value new_value_for_6 new_value_for_4 25 25 0.501 ns 1 ns
7 G value new_value_for_8 new_value_for_6 25 25 0.808 ns 0.808 ns
8 G value new_value_for_8 new_value_for_4 25 25 0.101 ns 0.303 ns
9 G value new_value_for_6 new_value_for_4 25 25 0.161 ns 0.321 ns
10 H value new_value_for_8 new_value_for_6 25 25 0.964 ns 0.964 ns
我刚刚为三个重复测量中的每一个创建了一个包含12个元素的列表,其中包含以下相对统计数据:
my_comparisons <- list(E = comparisons[1:3,],
F = comparisons[4:6,],
G = comparisons[7:9,],
H = comparisons[10:12,],
I = comparisons[13:15,],
J = comparisons[16:18,],
K =comparisons[19:21,],
L = comparisons[22:24,],
M = comparisons[25:27,],
N = comparisons[28:30,],
O = comparisons[31:33,],
P = comparisons[34:36,])
得到以下结果
[[E]]
# A tibble: 3 x 10
s .y. group1 group2 n1 n2 p p.signif p.adj p.adj.signif
<chr> <chr> <chr> <chr> <int> <int> <dbl> <chr> <dbl> <chr>
1 E value new_value_for_8 new_value_for_6 25 25 0.877 ns 1 ns
2 E value new_value_for_8 new_value_for_4 25 25 0.929 ns 1 ns
3 E value new_value_for_6 new_value_for_4 25 25 0.948 ns 1 ns
[[F]] .... and so on
因为你可以看到在信号列,根据我分裂列表有一些常见的字体(例如P3,FCz,LPPearly等).我想使用一个迭代函数,如lapply(),一些循环或map()函数,以自动化这个列表的创建.
先谢了
这里是原始数据集
> dput(head(df, 10))
structure(list(A = 1:10, C = c("Maybe", "Maybe", "Maybe", "Maybe",
"Maybe", "Maybe", "Maybe", "Maybe", "Maybe", "Maybe"), D = structure(c(1L,
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L), .Label = c("new_value_for_8",
"new_value_for_6", "new_value_for_4"), class = "factor"), E = c(988.368784828308,
988.856158671407, 996.004085290553, 999.685844324618, 1000.23888564896,
1005.03749946898, 999.786378084971, 997.039675082569, 998.028313183065,
997.168905747014), F = c(994.834756009939, 994.468875098246,
1000.62150212342, 1002.23100741241, 1003.96990710863, 1007.75899775608,
998.699806256246, 996.401009591011, 998.076594704249, 1002.19344184533
), G = c(1011.88022669726, 1012.10534266625, 1012.9554415821,
1015.09810043606, 1015.40462298842, 1016.67103699915, 1003.13771453335,
999.9107434841, 1002.15365554737, 1013.67789244066), H = c(988.221495702721,
990.850727928741, 992.418094914622, 995.984841639886, 993.398346143465,
997.971380355398, 1004.4672957051, 1002.54036572775, 1002.2292388993,
999.116379988893), I = c(994.035709684742, 994.890815628412,
997.18267770374, 998.564426335124, 996.851278420874, 1000.16039368502,
1003.52155765272, 1002.1043798945, 1002.7069399281, 1005.49897156208
), J = c(1008.23981597718, 1009.51261484649, 1009.42367409926,
1005.06332653216, 1005.02619159395, 1009.07903916629, 1007.56089165218,
1005.49719893791, 1004.91476855238, 1013.03209535721), K = c(994.327042030287,
995.608170991922, 997.033470393412, 1000.15918365269, 998.216388150646,
1001.97377908784, 1003.17401220482, 1001.60211665164, 1002.27932356239,
1002.41479226363), L = c(999.225538268699, 999.349990537239,
1001.14010250645, 1001.51403741206, 1000.25571835554, 1003.76051565494,
1002.74763442988, 1001.09116707486, 1003.29833843754, 1006.55857216695
), M = c(1009.99385579756, 1011.12126521731, 1010.6989716872,
1003.7899021821, 1004.59413830322, 1008.52123662618, 1006.34418311104,
1004.1077131243, 1004.94124365003, 1011.89121961563), N = c(999.801263745036,
996.838989582336, 1000.89599227983, 1003.11042068113, 1002.27800090558,
1003.83846437952, 1000.70169995102, 1001.75290674649, 998.660833714301,
1006.69246804854), O = c(1002.96437294923, 997.870867692911,
1002.94619035116, 1003.44844607015, 1003.02403433836, 1004.70457675466,
999.880559826981, 1000.66826545719, 999.59436981446, 1007.32640154038
), P = c(1006.28027312932, 1005.24535230967, 1007.68162285336,
1001.08242973466, 1002.99896314, 1005.36085942954, 1001.22060069797,
1000.43007709819, 1000.47666761108, 1008.73650967215)), row.names = c(NA,
10L), class = "data.frame")
1条答案
按热度按时间dced5bon1#
我想,你正在寻找类似以下的东西: