On 29/07/2020 6:34 p.m., Jeff Newmiller wrote:
To begin with, don't assume it is in C++... R supports multiple compiled 
languages, and rgl appears to have both C++ and C in it.

Also a few thousand lines of Javascript, but in this case, the interesting code is all in R.


I googled "r rgl github" and found an online copy of the src (source) files 
right away. The official way is to find the CRAN package page and download the tar.gz 
file and extract the files. Either way, you get the whole package source code this way.

If you're using RStudio, a really convenient way to view the source for a package whose source is on Github (maybe the majority of packages these days?) is to create a new project from it. Then you can use the built-in search functions to jump to the source of any function.

For rgl, you can get a copy of the Github mirror of the source by specifying the "Repository URL" as "https://github.com/rforge/rgl";, and the "Project directory name" as "pkg/rgl". (The source is hosted in Subversion on R-forge.r-project.org, but Subversion is less familiar to most people these days and R-forge is pretty old-fashioned, so I'd go with Github instead. There are some irritating things about Github.)

Once you've got it in RStudio, you can type "shade3d" in the "Go to file/function" box, and it will offer the generic as well as the two methods shade3d.mesh3d and shade3d.shapelist3d.

This kind of search is probably also possible in other front ends (ESS etc.), and some purists probably know how to set it all up in command line BSD Unix, but I don't.

Duncan Murdoch

I am afraid I don't have time to dig into the source to identify which file you 
need. Keeping in mind that the rgl package is an interface to lower level code, 
beware that you may need to leave the R code to find what you are looking 
for... in which case you would be dealing with a different code base and 
community of coders.

On July 29, 2020 2:35:33 PM PDT, Byron Dom via R-help <r-help@r-project.org> 
wrote:
How can I access the C++ source associated with the rgl function
shade3d. More specifically, I'm interested in the part of the code used
by arrow3d to draw arrow heads.

I'm not familiar with how GitHub is organized and I've put in a lot of
effort doing searches there and on the web in general. The result has
been a few fragments of rgl C++ code but not what I'm looking for.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to