Question
How to find the file that contains the code of an R function?
I have R 4.3.2 installed on my Windows PC. I downloaded it from https://cran.r-project.org/bin/windows/base/. I have not downloaded the .tar.gz file with the R source code.
I know how to view the code of a function. If I type chisq.test
in the console, for example, I get the code for the chisq.test
function. This is a base function from the package stats
.
The thing is: that code shown in the console must be stored somewhere, in some file on my computer. The code could not be displayed if it were not so.
Where is it? Is it a general method to find such locations?
I really tried to find it with no results. It's nowhere in C:/Program Files/R/R-4.3.2. I uploaded it to a GitHub repository and searched chisq.test
and got no results either. I also looked in other folders in the same hard drive and found nothing. I didn't find anything useful on stackoverflow either.
I expect the code to be stored somewhere.