-2

I am running the following code

 x=wilcox.test(rnorm(10), rnorm(10))

Now my question is: How to see the R code of this test? When I am running "wilcox.test" in console, it is printing

 function (x, ...) 
  UseMethod("wilcox.test")
 <bytecode: 0x3d73148>
 <environment: namespace:stats>

This question may be very trivial but I am stuck here.

Janak
  • 653
  • 7
  • 25
  • Interestingly enough, I dont get that output, i just get, x Wilcoxon rank sum test data: rnorm(10) and rnorm(10) W = 56, p-value = 0.6842 alternative hypothesis: true location shift is not equal to 0 – InfiniteFlash Mar 08 '16 at 08:02
  • 1
    @InfiniteFlashChess The output that you are describing can be obtained with `wilcox.test(rnorm(10), rnorm(10))`. But the OP is reporting on the output of `wilcox.test`, typed directly in the console, without passing arguments to the function and without parentheses at the end. – RHertel Mar 08 '16 at 08:15

1 Answers1

1

Use

methods("wilcox.test")

to find out which methods are implemented. Then use getAnywhere to see the method you are interested in:

getAnywhere("wilcox.test.default")
Karsten W.
  • 17,826
  • 11
  • 69
  • 103