[R] Problem with filled.contour/image

About this list Date view Thread view Subject view Author view Attachment view

From: Laura Quinn (laura@env.leeds.ac.uk)
Date: Thu 06 May 2004 - 19:41:12 EST


Message-id: <Pine.LNX.4.44.0405061032350.4967-100000@env-pc-phd13>

Quick question - I am having problems creating an orographic image
(similar to volcano example). I have created a map matrix with 3 columns
and over 2million rows.

I have created the matrix as follows:
map<-read.table("map.dat",header=TRUE)
long.grid<-sort(unique(map$long)
lat.grid<-sort(unique(map$lat)
map.matrix<-matrix(map$height,nrow=length(lat.grid),byrow=TRUE)

The problem is when I type the filled.contour
command I get the following error message:

filled.contour(long.grid,lat.grid,t(map.matrix),color=terrain.colors)

Error in filledcontour(as.double(x), as.double(y), z, as.double(levels),
:
        dimension mismatch

and when I try using the image function:

image(long.grid,lat.grid,t(map.matrix),col=terrain.colors(50),axes=TRUE)

I get the following error:

Error in image.default(long.grid, lat.grid, t(map.matrix), col =
terrain.colors(50), :
        dimensions of z are not length(x)(+1) times length(y)(+1)

Each long and lat point are unique and have a corresponding height
component so these messages don't make any sense to me - can anyone please
advise?

Thanks

Laura

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:08 EST