[R] Accessing the C++ source associated with the rgl function shade3d

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Thu Jul 30 11:23:11 CEST 2020


On 29/07/2020 7:27 p.m., Rasmus Liland wrote:
> Dear Byron,
> 
> On 2020-07-29 18:04 -0400, Duncan Murdoch wrote:
>> The arrow3d function is also a pure R
>> function, but not a generic.  You can
>> see the source by typing "arrow3d".
> 
> ... but if I type rgl::shade3d, I get
> 
> 	> rgl::shade3d
> 	function (x, ...)
> 	UseMethod("shade3d")
> 	<bytecode: 0x562692966fb8>
> 	<environment: namespace:rgl>

That includes the full source code to shade3d.  Like most generic 
functions, it's a one-liner.

In the part of my post that you deleted, I told the OP where to look next.

> 	> dput(rgl::shade3d)
> 	function (x, ...)
> 	UseMethod("shade3d")
> 
> I've observed this is possible in the
> past, but now I can't remember how ...
> 
> On 2020-07-29 15:34 -0700, Jeff Newmiller wrote:
>> On July 29, 2020 2:35:33 PM PDT, Byron Dom wrote:
>>> I'm not familiar with how GitHub is
>>> organized
>>
>> 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.
> 
> I have a hunch this is the file you're
> looking for
> https://github.com/cran/rgl/blob/master/R/ashape3d.R

No, that's not it.  That file works with mesh3d objects, but it has 
nothing to do with arrows.

Duncan Murdoch

> 
> Remember, dealing with code on github is
> just a small uptick from how Linux was
> developed before, by shipping around
> diffs and tarballs on a mailing list
> much similar to this one, Thorvalds
> merging them into the kernel in the
> authoritarian way.
> 
> You can do it!  *cheers*
> 
> Best,
> Rasmus
> 
> [1] http://gameoftrees.org/
>



More information about the R-help mailing list