Skip to content
Prev 11671 / 29559 Next

Help with rounding legend intervals within a function

On Thu, 12 May 2011, Christopher S. Fowler wrote:

            
Correct diagnosis. I can't see an obvious way of fixing the bug in 
classIntervals() quickly, so for the time being, assign the object to the 
global environment within the function:

...
brks[length(brks)]<-(ceiling(max(class$brks)*1000))/1000 #makes sure
         #upper bound is rounded up so it includes highest value
assign("brks", brks, globalenv())
class <- classIntervals(plotvar, nclr, style="fixed", fixedBreaks=brks)
...

I'll try to fix this later.

Roger