[R] voronoi.mosaic chokes?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed May 9 07:18:50 CEST 2007
On Wed, 9 May 2007, Christos Hatzis wrote:
> Have you tried 'debug'?
> With one of the datasets that crashes your system, run the first
> voronoi.mosaic, then the torus function and then
> and run through the second call of voronoi.mosaic. You can step though the
> code and at least will you find the point where it bombs.
What does 'bombs' mean, and what does 'freeze' mean (the posting guide
asks you not to use such imprecise language)? My guess is that the R
process is running at ~100% of the CPU and not returning to the top-levl
prompt nor is it interruptible.
If so, I believe you will find it is inside the Fortran code. (I think I
have seen similar examples in the past, which is why I tend not to use
tripack, not akima which has also misbehaved.)
Have you sent the problem to the package maintainer?
>> -----Original Message-----
>> From: r-help-bounces at stat.math.ethz.ch
>> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Andrew Pierce
>> Sent: Wednesday, May 09, 2007 12:21 AM
>> To: r-help at stat.math.ethz.ch
>> Subject: [R] voronoi.mosaic chokes?
>> Hi all,
>> I am running R 2.5.0 under Windows XP Media Center Edition.
>> Here's a problem that's been stumping me for a few days now,
>> and I can't find anything useful in the archives. I am using
>> voronoi.mosaic (tripack
>> package) to create proximity polygons for a study of
>> vegetation competition and dynamics. The points lists are
>> read in from a file for each plot, then 8 duplicates are
>> translated around the edges of the plot (Toroidal edge
>> correction). This is completed using the torus(...) function
>> that I wrote myself.
>> VMuncorrected is the voronoi mosaic that is not toroidally
>> edge corrected VMcorrected is the voronoi mosaic that is
>> toroidally edge corrected
>> >treemap = read.table('af1.txt', sep = "\t", header = 1)
>>> VMuncorrected = voronoi.mosaic(treemap$X, treemap$Y)
>> ###Use the torus function to create 8 copies around the study
>> region >toroid = torus(treemap$X, treemap$Y, 25, 25)
>> >VMcorrected = voronoi.mosaic(toroid[,1], toroid[,2],
>> duplicate = "remove")
>> Here's the problem. When I read in the points for the data
>> file listed above ('af1.txt'), both calls to voronoi.mosaic()
>> work fine. (The second one takes about 1.5 seconds because
>> there are 1147 points in the toroidally corrected set).
>> However, when I read in the points from the next file
>> ('af2.txt'), the first call to voronoi.mosaic() works. The
>> next call (to torus()) also works fine. But the second call
>> to voronoi.mosaic() causes R to freeze completely requiring
>> I have 10 sets of points and this problem happens for about 5 of them.
>> Factors I have ruled out:
>> -too many points in the call (one set had 1147 and worked
>> fine while the next set had 801 and froze R) -duplicate
>> points (taken care of by voronoi.mosaic(..., duplicate =
>> "remove") and also independently verified by exporting the
>> data. no duplicates in either the original or the toroidally
>> corrected set) -points too close together in space (minimum
>> distance between two points in 'af1.txt' is 0.1414 and works
>> fine. minimum distance in the second set, 'af2.txt', is
>> 0.2236, and this set causes R to freeze) -not enough memory
>> (each data set is run in a new R session-i.e. R was quit
>> between each attempt) -'flukiness' (the problem happens the
>> same way every time for the problem data sets, and the code
>> runs fine every time for the non-problem data sets) -file
>> formats (each text file has the same number of columns, all
>> the labels for the columns are identical, and the columns are
>> always in the same order) -outdated versions (I am using R
>> 2.5.0 and updated the tripack package within the last week.
>> also, I update packages about once a month)
>> This is a very frustrating problem because I get no errors
>> indicating any problem with the data, and I have checked the
>> data over and over for any type of error and found none. If
>> anyone has ANY helpful suggestions, I would love to hear
>> about any and all of them.
>> p.s. - for those of you who are really intrigued, I can email
>> you the .txt files and the code for the torus() function.
>> R-help at stat.math.ethz.ch mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help