[R] contour and persp help please

Bill Simpson wsimpson at gcal.ac.uk
Tue May 4 13:56:29 CEST 1999


I have data saved in files on disk in following format
x	y	z
------------------
1	1	1
1	2	2
2	1	3
2	2	4

Normally I read the file into a data frame, but suppose I do it this way:
x<-seq(1,2)
y<-seq(1,2)
z<-seq(1,4)
data<-data.frame(x,y,z)
image(unique(data$x),unique(data$y),data$z, col=gray(0:19/19),
xlab="x", ylab="y")

I was helped at some point in the past on image().  However I can't figure
out how to make a contour plot or a persp plot. The help pages don't give
an example similar to mine.  Unfortunately Venables & Ripley don't discuss
contour or persp either (and maybe S-Plus differs from R anyway).

Thanks very much for any help!

Bill Simpson

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list