[STATSGRASS] R contour(): x,y output

Roger Bivand Roger.Bivand at nhh.no
Tue Apr 2 11:21:48 EST 2002


On Fri, 22 Mar 2002, Agustin Lobo wrote:

> 
> I forward this message (with permission) 
> as I think that it is interesting for the 
> list.
> 

I've had a shot at recovering the contour lines from inside contour; a
tarball with modified: src/main/plot3d.c src/library/base/R/contour.R
src/library/base/man/contour.Rd is on:

ftp://reclus.nhh.no/pub/R/contour.tar.gz

I've checked them on a recent R-patched, and they seem to work so far. A
new argument to contour() called return.contours should be set equal to
TRUE to return a list object - see the manual page. 

Paul - if you think they are OK, please use them as you wish. I  have
commented most changes (the ones I could find!), but draw your attention
to my having commented out vmax[sg]et in do_contour() and contour(), they
were causing too much trouble. I've run a loop of 100 examples watching
top, and can't see any memory bloat caused by letting the garbage
collector take care of recouping memory. On my machine (RH7.1, PIII
933MHz) the top RSS just stays at 20M.

Roger

> 
> 
> ---------- Forwarded message ----------
> Date: Thu, 21 Mar 2002 10:37:08 +1200
> From: Paul Murrell <p.murrell at auckland.ac.nz>
> To: Agustin Lobo <alobo at ija.csic.es>
> Subject: Re: suggestion
> 
> Hi
> 
> 
> > Paul,
> > your TODO list in
> > http://developer.r-project.org/paul-todo.html
> > mentions
> > "* I am compiling a list of missing features or inconsistencies in R
> > graphics that I'd like to get to..."
> >
> > Related to this, would it be possible to get the x,y coordinates
> > of the vertices in the contours() function? I mean a couple
> > of vectors that could be plotted with lines(). Having this, it
> > would be possible to write a a function to write these
> > coordinates to a file in dxf format, which would be very
> > useful for linking R to GIS packs.
> 
> 
> I agree this is a good idea.  There is a plan to do just such a thing in
> order to make contour plotting possible in the lattice package.  The bad
> news:  I suspect the next time I'll get a chance to try and do this is
> probably only for R1.6 (i.e., for around September some time I think).
> Would that still be useful to you?
> 
> Paul
> 
> 
> 
> _______________________________________________
> statsgrass mailing list
> statsgrass at grass.itc.it
> http://grass.itc.it/mailman/listinfo/statsgrass
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
and: Department of Geography and Regional Development, University of
Gdansk, al. Mar. J. Pilsudskiego 46, PL-81 378 Gdynia, Poland.





More information about the grass-stats mailing list