View source code for a package (that is not on GitHub or similar platform)


I'm trying to view the source code for a package that is not (as far as I can tell) on GitHub or a similar platform. What options do I have to do this? My vague hunch is that it has something to do with installing and "unzipping" one of the binary files, but I really don't have an idea!


If it's on CRAN, the Package Source is available on the package index page. Unzip + untar that file and you get the same directory that would be on a GitHub repository.


You can use the CRAN mirror on GitHub by METACRAN:


If it is a package you have installed, I think you can also use the fix and edit functions to see the source code of any (exported?) function.


@mara happened to share this on Twitter: also looks useful @jimhester's lookup package.