The persp function expects z to be a matrix, so you could reshape your data so
that z is a matrix (the reshape function or package may help). Or the wireframe
function in the lattice package expects data more like what you show, that may
be the easiest solution.
--
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 Mauro
> Sent: Thursday, May 05, 2011 10:09 AM
> To: r-help at r-project.org
> Subject: [R] perspective plot
>
> Hello,
>
> I`m tryint to plot some variable over x and y coordinate, but can`t
> figure
> out hot to do it ( I could do a simple scatterplot3d, but there I can`t
> change the viewing angle).
>
> My dataset looks something like this (dataframe):
>
> X Y Q95
> 21 2628711 1104437 0.7723994
> 22 2628721 1104437 0.5961789
> 23 2628731 1104437 1.2013182
> 24 2628741 1104437 1.3468632
> 25 2628751 1104437 1.1035517
> 26 2628761 1104437 1.0528809
>
> Is there a way to plot Q95 over x and y? Something like persp(x,y,z)
> would
> be nice, but can`t figure out the right input format for this function.
>
>
> Thanks a lot,
>
> Mauro
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/perspective-plot-tp3498754p3498754.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.