Re: [R] Remove squares from scatter3D

From: Peter Ehlers <ehlers_at_ucalgary.ca>
Date: Wed, 23 Jun 2010 10:25:47 -0600

On 2010-06-22 15:40, moleps wrote:
> Dear All,
>
> Ive been trying to find an option to scatter3D from rcmdr to remove the individual points from the plots but to no help so far. Removing the residuals is easy, but I cannot find a similar point option. Is there such an option that can be set to FALSE?
>

Are you trying to plot a regression plane without the data points? I can't think of a good reason, but you could presumably use rgl directly.

Using scatter3d, this may be possible with some setting for the point.col argument but I couldn't see it.

You can always modify the scatter3d() code. A quick look shows that it might suffice to wrap the call to rgl.spheres and/or rgl.points in a test for whether to draw points or not.

Here's what worked for me:

  1. copy scatter3d() to myscatter3d()
  2. add an argument: draw.points = TRUE
  3. wrap the code (near top of scatter3d)

      size <- sphere.size * ((100/length(x))^(1/3)) * 0.015

      .... (more code)

           else rgl.points(x, y, z,
             color = surface.col[as.numeric(groups)])
     }

   with

     if(draw.points){}

Be warned: I haven't tested this much, haven't studied the rest of scatterplot3d() much, and I have not tried to use Rcmdr's menus.

   -Peter Ehlers

>
> Best,
>
> //M
>



R-help_at_r-project.org mailing list
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. Received on Wed 23 Jun 2010 - 16:27:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jun 2010 - 17:10:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive