I would like to extract only the p-values from an apply-function. I did the several statistical tests (shapiro-test, kruskal-Vallis and ANOVA) over several columns (A-D). It works aut, but I always get a the whole list as results.
My data.frame is calles data1.
b<-apply(data1 [,c("A", "B","C","D")],2,shapiro.test);b
If I add $p.value or $p.val to the function the outcome shows "NULL" ("Zero").
b<-apply(data1 [,c("A", "B","C","D")],2,shapiro.test)$p.val
b$p.val NULL
Can anybody help me in this matter?