[R] using popbio, reduce number of digits in image2 plot

Tali tvardi at ucsd.edu
Wed Jan 26 19:57:32 CET 2011


Hello All.

I am using the image2 plot function in the popbio package to create 6
elasticity analyses. I am trying to reduce the number of significant digits
that displays -- from 3 digits to 2. I tried rounding my original matrices,
but one is comprised primarily of zeros, and the cut / breaks options
returns an error message. (see code and error message below)

Here are the elasticity values that I'm working with. Matrix 2 "2005-2006"
is the one that is creating the problem. I tried fiddling with cut, breaks,
digit, rounding...to no avail.

Further, is there an easy way to turn the top side labels 90 degrees? 

Thank you Chris Stubbens for this wonderful code!

TV, PhD Candidate
Center for Marine Biodiversity and Conservation
Scripps Institution of Oceanography

elast:

, , 2004-2005

            1           2           3           4
1 0.017558594 0.003972943 0.002701352 0.006443492
2 0.011770698 0.106806350 0.020465566 0.022990744
3 0.001347089 0.047278966 0.258967762 0.061338978
4 0.000000000 0.003975099 0.086798115 0.347584256

, , 2005-2006

  1            2            3            4
1 0 0.000000e+00 0.000000e+00 0.000000e+00
2 0 6.872613e-17 2.641284e-17 3.763301e-17
3 0 0.000000e+00 0.000000e+00 0.000000e+00
4 0 0.000000e+00 0.000000e+00 1.000000e+00

, , 2006.1-2007

            1           2            3           4
1 0.006634579 0.002471288 0.0001750284 0.001891018
2 0.004537334 0.040648910 0.0076802263 0.014082075
3 0.000000000 0.023828347 0.1431152824 0.015278433
4 0.000000000 0.000000000 0.0312515256 0.708405954

, , 2007-2008

            1           2           3          4
1 0.022147389 0.007198642 0.001271820 0.01111264
2 0.015296663 0.065937859 0.005444441 0.01685541
3 0.004286438 0.030397868 0.157415674 0.04280021
4 0.000000000 0.000000000 0.070768252 0.54906670

, , 2008-2009

           1          2           3           4
1 0.02359622 0.00377114 0.001521911 0.007169308
2 0.01246236 0.05323351 0.009987896 0.014909244
3 0.00000000 0.03358836 0.060984960 0.016624312
4 0.00000000 0.00000000 0.038702865 0.723447911

, , 2009-2010

            1           2            3           4
1 0.005384555 0.002185377 0.0006226765 0.004539465
2 0.007347518 0.032320771 0.0065127002 0.010417766
3 0.000000000 0.022092608 0.0947136415 0.059574250
4 0.000000000 0.000000000 0.0745314819 0.679757189


layout(matrix(1:6,2,3,byrow=TRUE)); 
 		for (i in 1:6) {
 			image2(round(elast[,,i],2),
 			col = gray(seq(1,.4,-.1)))
 			}

Error in cut.default(log10(x), breaks) : 'breaks' are not unique


-- 
View this message in context: http://r.789695.n4.nabble.com/using-popbio-reduce-number-of-digits-in-image2-plot-tp3238622p3238622.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list