[R] 4 dimensional graphics

Greg Snow Greg.Snow at imail.org
Thu Jan 10 18:20:08 CET 2008


Petr,

You may want to look at the rgl package for doing the 3d plot, then code
the points using different sizes/colors for your value.

However, when looking at a 3 dimensional plot that has been projected
onto 2 dimensions (computer screen or paper), the ability to really
understand what you are seeing is limited and often wrong due to various
optical illusions.  I would suggest that using lattice graphics may be
more informative (slice along height and do plots with lat and long as y
and x and points by value, or other combinations).  You may also find
relationships by using functions like stars, symbols, my.symbols
(TeachingDemos), or faces (TeachingDemos) to plot more than 2 dimensions
(though you still need to be very careful in how you assign variables to
features).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of Petr PIKAL
> Sent: Thursday, January 10, 2008 9:42 AM
> To: hadley wickham
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] 4 dimensional graphics
> 
> Thank you
> 
> Basically I have a rectangular space (like an aquarium) in 
> which I made some analysis. I can make
> 
> image(lat, long, value) for each height but what I dream 
> about is to make something like scatterplot3d(lat, long, 
> height) with points set according to a value.
> 
> Up to now i can do
> 
> scatterplot3d(sloupecn, radan, vrstvan, 
> color=as.numeric(cut(value, c(0, 100, 400, 1000))))
> 
> which will give you green and red points in upper right 
> corner. I started to try to make cex.symbols scaled according 
> to value too but up to now I did not manage to work correctly. 
> 
> in
> 
> scatterplot3d(sloupecn, radan, vrstvan, cex.symbols = 
> value/max(value)+2, color=as.numeric(cut(value, c(0, 100, 
> 400, 1000))))
> 
> the biggest points are at other places then I expected. 
> 
> here are the data
> 
> vrstvan sloupecn        radan   value
> 1       4       1       73.8
> 1       4       9       54.9
> 1       4       17      72
> 1       1       1       96
> 1       1       9       52.1
> 1       1       17      53.3
> 4       4       1       58.4
> 4       4       9       93.5
> 4       4       17      140.2
> 4       1       1       90.3
> 4       1       9       36.5
> 4       1       17      55.1
> 7       4       1       169.1
> 7       4       9       718
> 7       4       17      813
> 7       1       1       73.4
> 7       1       9       46.5
> 7       1       17      205
> 
> Petr
> petr.pikal at precheza.cz
> 
> "hadley wickham" <h.wickham at gmail.com> napsal dne 10.01.2008 16:07:31:
> 
> > On Jan 10, 2008 8:36 AM, Petr PIKAL <petr.pikal at precheza.cz> wrote:
> > > Dear all
> > >
> > > I want to display 4 dimensional space by some suitable way. I 
> > > searched CRAN and found miscellaneous 3 dim graphics 
> packages which 
> > > I maybe can modify but anyway I am open to any hint how to 
> > > efficiently display
> data
> > > like:
> > >
> > > longitude, latitude, height, value
> > 
> > What exactly are you interested in?  I'd start with plots of:
> > 
> >  * long, lat, height
> >  * long, lat, value
> >  * height, value
> > 
> > to give you a feel for what is going on.
> > 
> > Hadley
> > 
> > 
> > --
> > http://had.co.nz/
> 
> ______________________________________________
> 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.
> 




More information about the R-help mailing list