[R] Identifying a subset of observations on a 3d-scatter plot using cloud()

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue Dec 9 01:56:44 CET 2008


On Sat, Dec 6, 2008 at 9:27 PM, Giam Xingli <giam at nus.edu.sg> wrote:
> Hello everyone,
>
> This is my first post to the mailing list, so I hope I am posting my message the correct way.
>
> I am trying to present my dataset in a 3d scatterplot using cloud() in the {lattice} package. I hope to explicitly identify a subset of my observations. The observations in this subset need to satisfy the following critera (values on x,y, and z axes above a certain cutoff value). It will be great if I can get advice on how to annotate the points representing the subset of observations with a different colour, and if possible, label the points.
>

For colors, you could try

cloud(z ~ x * y, ..., groups = (x > c1 & y > c2 & z > c3))

For interactive labeling, see ?panel.identify.cloud. Direct labeling
is also possible, but you need to write a panel function
('panel.3dtext' in the latticeExtra pacakge may help).

-Deepayan



More information about the R-help mailing list