Skip to content
Back to formatted view

Raw Message

Message-ID: <52331AC8.3060601@tu-dresden.de>
Date: 2013-09-13T14:01:44Z
From: Thomas Petzoldt
Subject: numerical issue in contour.default?

Dear R developers,

I found a small issue while plotting contours of data containing both
"usual" and "very small" numbers. It appeared with both R 3.0.1 and
R-Devel on Windows, and I could reproduce it on Linux. Would it be
possible to solve this before the upcoming release?

Thanks a lot for developing this great software!

Thomas


Example:
########


set.seed(357)
z1 <- matrix(runif(100, -1e-180, 1e-180), nrow = 10)
contour(z1)    # ok

z2 <- matrix(c(runif(50, -1, 1), runif(50, -1e-180, 1e-180)), nrow = 10)
contour(z2)   # Error in contour.default(z) : k != 2 or 4

contour(z2 * 1e20)        # 20 worked, 19 produced error
contour(round(z2, 179))   # rounding to 179 digits works but not 180


> sessionInfo()
R Under development (unstable) (2013-09-11 r63910)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base





-- 
Dr. Thomas Petzoldt
Technische Universitaet Dresden
Faculty of Environmental Sciences
Institute of Hydrobiology
01062 Dresden, Germany

E-Mail: thomas.petzoldt at tu-dresden.de
http://tu-dresden.de/Members/thomas.petzoldt