数据传到这里了:https://github.com/onkaparinga/default/blob/main/pairedt.csv
水平有限,尝试一下:
library(tidyverse)
#读取
df <- read_csv('pairedt.csv')
#清洗
a <- df %>%
select(-1,-2) %>%
slice(seq(1,nrow(df),by = 2))#选1,3,5...行
b <- df %>%
select(-1,-2) %>%
slice(seq(2,nrow(df),by = 2))#选2,4,6...行
#批量计算
bind_cols(a,b) %>%
t() %>%
as_tibble() %>%
map_dbl(~t.test(.x[1:4],.x[5:8],paired = T)$p.value)