One-sample t-test uses the mean to test for deviation of sample data from the centre, and One-sample Wilcoxon signed Rank test uses the median, where are the Ranks in the latter?
Consider the following set of observations. The median is 20, but the one-sample signed rank test comparing it to a default value of 20 will return a p-value of < 0.05.
In contrast, the one-sample sign test --- which is a test of the median --- will return a p-value of 1.
PPS: this is true for any skewed distribution. Only for symmetric distributions, the Wilcoxon signed rank test is a test of the median and as well a test of the mean.
Note: the "SignTest()" function from the library DescTools is just a binomial test on the hypothesis p=0.5:
binom.test(sum(A>mu), n = length(A), p = 0.5)
You can use this to test any other quantile of the distribution.
For those wishing to understand the sign test. My understanding is that ties are ignored. So, for the one-sample case, e.g. A > mu is counted, and A != mu is counted. and then binom.test(sum(A>mu), sum(A!=mu), p = 0.5) is the test.
For the two-sample case, e.g. B > C is counted, and B != C is counted, and then binom.test(sum(B>C), sum(B!=C), p=0.5) is the test.
I guess it also bears saying that it doesn't matter if you count e.g. A > mu or A < mu, or B > C or B < C.