[R] Parametric Curves

Liaw, Andy andy_liaw at merck.com
Wed Jun 2 04:55:40 CEST 2004



> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Deepayan Sarkar
> Sent: Tuesday, June 01, 2004 10:49 PM
> To: r-help at stat.math.ethz.ch
> Cc: Talita Leite
> Subject: Re: [R] Parametric Curves
> 
> 
> On Tuesday 01 June 2004 09:01, Talita Leite wrote:
> > Hi everybody!
> >
> > I'm trying to plot a parametric curve (three dimensions) using R but
> > I didn't obtain good results. Somebody have already done something
> > like that? Please help me!
> 
> Could you give us more details ? To me, this would be having 
> 3 numeric 
> vectors (say x, y and z), and plot them joining consecutive points by 
> lines. If that's what you want, see ?cloud in the lattice 
> package. (You 
> will need to use type = 'l' for lines.)
> 
> Deepayan

Deepayan is right, of course.  Here's a simple example:

t <- seq(0, 4*pi, length=500)
x <- sin(t)
y <- cos(t)
z <- t
library(lattice)
cloud(z ~ x * y, type="l")

HTH,
Andy




More information about the R-help mailing list