I am trying to get code to automatically perform a Wilcoxon test on multiple columns and present the results for each column of data without having to change the column name for each.
I tried:
wilcox.test(ABRet$ABR7, mu = 0, alternative = "less") which gives me the correct answer
Wilcoxon signed rank test with continuity correction
data: ABRet$ABR7 V = 4396, p-value = 0.7384 alternative hypothesis: true location is less than 0
BUT I do not want to change ABRet$ABR7 to ABRet$ABR8 and then to ABRet$ABR9 for each of the columns I want to test.
I have tried sapply(wilcox.test(ABRet, mu = 0, alternative = "less"))
BUT get the following error: Error in match.fun(FUN) : argument "FUN" is missing, with no default