Skip to content

function classIntervals {classInt}: arguments over/under/between

3 messages · RINNER Heinrich, Pascal Oettli, Roger Bivand

#
Hello,

while making some choropleth maps wit R (version 3.0 under Windows7) I ran into an issue with function classIntervals (in package classInt):
I'm not able to change the character string value for "over"/"under"/"between" in printed table labels.

For example:
style: equal
  one of 3,921,225 possible partitions of this variable into 5 classes
  [15.57,43.516)  [43.516,71.462)  [71.462,99.408) [99.408,127.354)  [127.354,155.3] 
              35               44               17                4                2
style: equal
  one of 3,921,225 possible partitions of this variable into 5 classes
  [15.57,43.516)  [43.516,71.462)  [71.462,99.408) [99.408,127.354)  [127.354,155.3] 
              35               44               17                4                2 

--> It seems to me that arguments "over"/"under"/"between" are being ignored, setting them has no effect on the output?

I tried with findColours as well, also with no effect:
[...]
attr(,"table")
  [15.57,43.516)  [43.516,71.462)  [71.462,99.408) [99.408,127.354)  [127.354,155.3] 
              35               44               17                4                2

I have seen examples (Fig. 3.5 in the book "Applied Spatial Data Analysis with R") where classIntervals has behaved differently (?), so maybe something has changed here, or I am missing something?
What can I do to make this work? 

Kind regards,
Heinrich.
#
Hi,

 From the help file:
"From version 0.1-11, the default representation has been changed to use 
cutlabels=TRUE, and representation within intervals has been corrected, 
thanks to Richard Dunlap."

You need to use cutlabels=FALSE

print(classIntervals(jenks71$jenks71, n = 5, style = "equal"), cutlabels 
= FALSE, between = "-", under = "<", over = ">")

Regards,
Pascal
On 12/06/13 18:17, RINNER Heinrich wrote:
#
On Wed, 12 Jun 2013, RINNER Heinrich wrote:

            
The help page for classIntervals() notes that the cutlabels= argument was 
given a default of TRUE at a revision after the first edition of the book 
was published, so the code which used to give fig 3.15 (p. 79) now gives 
labels as returned by the cut() function, and documented there. To get 
back to the original form, use cutlabels=FALSE in methods for 
"classIntervals" objects:

cI <- classIntervals(jenks71$jenks71, n = 5, style = "equal")
print(cI, cutlabels=FALSE)
attr(findColours(cI, pal = 1:5, cutlabels=FALSE), "table")

The under=, over= and between= arguments are respected when 
cutlabels=FALSE.

Hope this clarifies,

Roger