我的数据看起来像这样
df<- structure(list(Accession = c("AAAAA", "AAAAA", "MYDDD", "MYDDD",
"STDTTT", "STDTTT"), grp = c("Rep1", "Rep2", "Rep1", "Rep2",
"Rep1", "Rep2"), First = c(24.8432602, 25.16806123, 33.36984063,
33.59779257, 30.93297676, 31.71292828), Condition1 = c(28.74214021,
28.68311263, 36.89735285, 37.12617154, 35.67871257, 35.89283737
), Condition2 = c(28.60045356, 27.5609252, 36.85154916, 36.25666317,
35.3600596, 34.87004551)), class = "data.frame", row.names = c(NA,
-6L))
每个事件有两个重复样本,称为Rep1和Rep2,我知道如何计算中位数和SD,但不知道如何将p值添加到其中
有何评论?
我就是干这个的
mydf<- df %>% dplyr::mutate(across(where(is.numeric),
list(median= ~ median(.x), SD = ~ sd(.x)))) %>%
pivot_wider(names_from = grp, values_from = First:Condition2)
1条答案
按热度按时间np8igboo1#
这就是你要找的吗?
如果你给予我更多的指示,我会尽力进一步帮助你。