8

Embarrassingly basic question.

When wanting to understand R's source code I will often just write its name in R and read through the code. The downside of this method is that I will get the code with its comment stripped away.

Assuming I use git, and not subversion, what simple solutions do I have to view the source code?

For example, can I download the R's source code through git? (as in with github)

Is there some website with all of the code easily searchable?

Thanks.

3
  • 5
    Suraj Gupta keeps a copy of the R releases in his git repo (note this doesn't include R-devel). Commented Aug 9, 2012 at 15:11
  • 1
    Why can't you use a SVN web browser to view the code? Why can you not use SVN to check out the code? Commented Aug 9, 2012 at 15:55
  • 2
    Dirk, that is what I am asking - what is the "easiest to have" method. I do not know what an SVN web browser is. As to using SVN, I would rather use git since this is what I already use for other projects (if possible) Commented Aug 9, 2012 at 20:08

1 Answer 1

6

To download the current R-development svn using git-svn (you might need to install git-svn in addition to git):

git svn clone https://svn.r-project.org/R/trunk/

To browse R-project source code online, just visit the same site:

https://svn.r-project.org/R/trunk/

Or, for the other branches:

https://svn.r-project.org/R/

To search for, say, glm() related code in the R-development source code, I usually try a Google search:

glm site:svn.r-project.org/R/trunk/
Sign up to request clarification or add additional context in comments.

1 Comment

@TalGalili: I know it works with git-bash. I assume git-gui has the same capability, but I usually use git-bash on Windows.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.