Here my data
mydat=structure(list(id = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), group = c(1L,
1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 3L, 3L, 3L, 3L), var = c(23L, 24L, 24L, 23L, 23L,
24L, 24L, 23L, 23L, 24L, 24L, 23L, 23L, 24L, 24L, 23L, 23L, 24L,
24L, 23L, 23L, 24L, 24L, 23L)), .Names = c("id", "group", "var"
), class = "data.frame", row.names = c(NA, -24L))
I want to join two tables. id is identificator.
library(tidyverse)
mdyat %>%
with(.,pairwise.wilcox.test(var,id, group, exact =F)) %>%
broom::tidy() %>%
complete(id,group) %>%
left_join(mydat %>%
group_by(id,group)) %>%
summarise_all(c("mean", "sd", "median"))
by=c("id,group")
and get the error
Error in match.arg(p.adjust.method) :
'arg' must be NULL or a character vector
How to do that this script performed for each indentificator separately I.E. Desired output
id mean sd median p.value
1 1 23,5 0.5773503 23,5 NA
1 2 23,5 0.5773503 23,5 1
1 3 23,5 0.5773503 23,5 1
2 1 23,5 0.5773503 23,5 NA
2 2 23,5 0.5773503 23,5 1
2 3 23,5 0.5773503 23,5 1