I have two dataframes of the sort
a b c
1 2 3
2 3 3
1 2 3
使用相同的列名。我正在使用
mapply(t.test, df1, df2)
将比较两个数据框中的a、b和c类型列的t.text结果输出。这将产生(实际结果):
LHM
statistic -11.5671
parameter 90.46322
p.value 1.575918e-19
conf.int Numeric,2
estimate Numeric,2
null.value 0
alternative "two.sided"
method "Welch Two Sample t-test"
data.name "dots[[1L]][[23L]] and dots[[2L]][[23L]]"
RaM
statistic -18.66368
parameter 172.2032
p.value 3.200675e-43
conf.int Numeric,2
estimate Numeric,2
null.value 0
alternative "two.sided"
method "Welch Two Sample t-test"
data.name "dots[[1L]][[24L]] and dots[[2L]][[24L]]"
等等(在每个数据帧中我有大约180列数据)。 我需要将列名及其对应的p值存储在矩阵中。 在另一列中存储哪个数据帧包含更高的值也会很有帮助。 请帮忙?
$p.value
进行调用。 - daikonradish